4772 lines
2.4 MiB
4772 lines
2.4 MiB
<!DOCTYPE html><html><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=100"/><style>.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:0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;height:53px;line-height:53px;border:0;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:0;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:0}.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:0}.ui-datepicker th{width:40px;height:28px;border-bottom:1px solid red;padding:0;border:0;border-bottom:1px solid #d6d6d6;text-align:center;font-weight:400;color:#8d9196;background-color:#f8f8f8}.ui-datepicker td{border:0;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:0;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:0}.ui-datepicker tr:last-child td span:not(.ui-state-highlight),.ui-datepicker tr:last-child td a:not(.ui-state-highlight){border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 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;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)}}}}.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:16px;white-space:nowrap;padding:5px 9px 5px 13px;margin:0 21px 5px 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}}}.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}.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;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.editable.editing{background:#f4f7f9}.viewchart-column-main .chart-description .tv-button{border:0;border-radius:0}.viewchart-column-main .chart-description{.edit,.submit{.button-base-color();color:#fff!important}}.viewchart-column-main .chart-description .edit,.viewchart-column-main .chart-description.editable.editing .edit,.viewchart-column-main .chart-description .submit{position:absolute;top:3px;right:3px;visibility:hidden}.viewchart-column-main .chart-description .cancel{position:absolute;top:28px;right:3px;visibility:hidden}.viewchart-column-main .chart-description.editable .edit,.viewchart-column-main .chart-description.editable.editing .submit,.viewchart-column-main .chart-description.editable.editing .cancel{visibility:visible}.viewchart-column-main .chart-description.editable .edit,.viewchart-column-main .chart-description.editable .submit,.viewchart-column-main .chart-description.editable .cancel{width:35px;text-align:center}.viewchart-column-main .chart-description textarea{background:#f5f5f5;border:0;width:100%;min-height:82px;font-family:sans-serif;margin:0;padding:0;resize:vertical;vertical-align:top;font-size:16px;line-height:24px}.viewchart-column-main .chart-description textarea{display:none}.viewchart-column-main .chart-description.editing textarea{display:block}.viewchart-column-main .chart-description.editing div{display:none}.chart-related-block{padding:10px 0;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;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}.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:950px;min-height:315px;top:50%;left:50%;margin-top:-157px;margin-left:-475px;.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;font-size:14px}a.embed{cursor:pointer;border-bottom:1px dashed #5590d1;font-weight:700}a.embed.active{border:0;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:355px}.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}.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}.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{cursor:pointer;margin-top:4px}.embeded-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:0;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:0}.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%}#library-container{border:1px solid #D9DADB;background:#fff}#library-container #showExtendedHoursLink{display:none}#library-container .header-chart-panel{min-height:0}.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-items li{width:140px;height:13px;padding:8px 5px;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:0;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-custom-logo .inner{display:block;padding: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;-webkit-transition:background .7s ease;-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;-webkit-transition:background .7s ease;-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,rgba(255,255,255,1) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,rgba(255,255,255,0)),color-stop(100%,rgba(255,255,255,1)));background:-webkit-linear-gradient(top,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-o-linear-gradient(top,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:-ms-linear-gradient(top,rgba(255,255,255,0) 0,rgba(255,255,255,1) 100%);background:linear-gradient(to bottom,rgba(255,255,255,0) 0,rgba(255,255,255,1) 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:0}.onchart-tv-logo img.custom-image{position:relative;top:0;left:0;width:auto;height:auto}.pseudo{content:" "}.absolute-center{position:absolute;top:50%;left:50%}.text-overflow-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.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 -902px;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 -2254px;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 -2519px;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 -924px;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 -575px;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 -1838px;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 -2494px;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 -1121px;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 -2827px;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 -1146px;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 -2849px;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 url(images/index/learnmore-header-bg.png) 50% 100% repeat-x}.tv-footer{margin:-425px 0 0;height:425px;background:#26282f}.tv-content{padding:0 0 425px}.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{margin-top:-1px}.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}.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{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-select-container.sbHolderOpen,.tv-select-container:active{background:#f4f7f9;color:#f5f5f5}.tv-button.ok{min-width:30px;background:#06b2ce;border-color:#06b2ce;color:#fff!important}.tv-button.ok:hover{background:#06bfdd;border-color:#06bfdd}.tv-button.ok:active{background:#06a5bf;border-color:#06a5bf}.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:0}.tv-button.half-right{border-radius:0 3px 3px 0}.tv-button.cancel{background:#9ca0a6;border-color:#9ca0a6;color:#fff!important}.tv-button.cancel:hover{background:#a4a8ad;border-color:#a4a8ad}.tv-button.cancel:active{background:#94989f;border-color:#94989f}.tv-button.process{background:url(images/bar-loader.gif) 0 0 repeat}.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:hover{color:#000}.tv-select-container:hover a{color:#000}.tv-select-container:hover .sbToggle:after{border-color:#000 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 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:0}.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-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}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}img{border:0}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}.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:0}.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:40%}.open-script .columns.source{width:35%}.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:0}.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:40%}.open-script .list-header .item.source{width:35%}.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{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}.open-script .list-container .list .item .value.name{width:40%}.open-script .list-container .list .item .value.source{width:35%}.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 .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%;-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:11px 9px 11px 29px;width:100%;height:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;border:0}.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 26px 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:22px;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 26px 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:34px}.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:30px}.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.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:28px}.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{display:block;position:absolute;top:9px;right:8px;visibility:hidden;width:16px;height:14px;background:url(images/icons.png) -159px -362px}.insert-study-items li.custom-script .agrees{display:block;position:absolute;top:7px;right:28px;width:auto;height:19px;line-height:19px;text-align:right;opacity:.6;color:#dadcde}.insert-study-items li.custom-script:hover .agrees{opacity:1;color:#a8afb3}.insert-study-items li.custom-script .source:hover{background:url(images/icons.png) -180px -362px}.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 .source,.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{font-style:italic;color:gray}.insert-study-items li .open-chart-popup{display:inline-block;position:relative;width:10px;margin:-1px 10px;padding:0 4px;visibility:hidden;border:1px solid #d6d6d6;background:#fff}.insert-study-items li .open-chart-popup:hover{border-color:#b5b7b9}.insert-study-items li:hover .open-chart-popup{visibility:visible}.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;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}.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:20px 0 8px 28px}.insert-study-header .tv-dialogs-label-hint{margin-left:4px;position:relative;top:2px}table.buttonex-popup{border-collapse:collapse;background:#fff;background:rgba(255,255,255,.9);border:1px solid #6d7685;z-index:5;box-shadow:0 1px 2px rgba(0,0,0,.3);padding:1px}table.buttonex-popup tr.active{background:#d1e1f8;font-weight:700}table.buttonex-popup td{color:#595959;font-size:12px}table.buttonex-popup td:last-child{padding:0 25px 0 5px}tr.buttonex-popup-hover{background-color:#f4f7f9;cursor:pointer}table.buttonex-popup tr.disabled{background:0 0;cursor:default}table.buttonex-popup tr.disabled td{color:#a0a0a0}table.buttonex-popup tr.has-submenu td:last-child{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAKElEQVR4AWOgExgFo6Cvr+8/1Q0EYaoaCMNUNBCBB68LqRvLIxiMAgAKDyqRblYs2AAAAABJRU5ErkJggg==) 100% 50% no-repeat}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:0!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:0!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 9px;background-color:#000;color:#fff;border:#fff 1px solid;font-size:11px;font-weight:600;white-space:pre}.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-width:400px;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.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;min-width:400px}.tv-dialog-content .main{padding:0 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-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 .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 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;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;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}.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}.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-dialogs-name{margin-top:13px;margin-bottom:4px;vertical-align:middle}.auth-dialog .main{padding:0 28px;width:402px}.auth-dialog .main .auth-dialog-socials{margin:19px 0;width:402px;overflow:hidden}.auth-dialog .main .auth-dialog-socials a{cursor:pointer;float:left;margin:5px;width:124px;height:17px;padding:11px 0;background:#999;color:#fff;text-align:center;font-size:14px;line-height:17px}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-facebook{background:#38569a}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-facebook:hover{background:#4c67a4}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-twitter{background:#06b1cd}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-twitter:hover{background:#1fbad3}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-google{background:#4587f7}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-google:hover{background:#5893f7}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-stocktwits{background:#8a1100}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-stocktwits:hover{background:#97291a}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-linkedin{background:#327eae}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-linkedin:hover{background:#488bb6}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-yahoo{background:#851e8d}.auth-dialog .main .auth-dialog-socials a.auth-dialog-social-yahoo:hover{background:#913599}.auth-dialog .main .auth-dialog-separator{position:relative;overflow:hidden;height:15px;text-align:center;margin:39px 0 34px}.auth-dialog .main .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 .main .auth-dialog-separator-copy::before,.auth-dialog .main .auth-dialog-separator-copy::after{content:" ";position:absolute;top:7px;height:0;border-top:solid 1px #dbdfe4;width:200px}.auth-dialog .main .auth-dialog-separator-copy::before{margin:0 100% 0 0;right:0}.auth-dialog .main .auth-dialog-separator-copy::after{margin:0 0 0 100%;left:0}.auth-dialog .main form .auth-dialog-field{display:block;position:relative;margin:17px 0}.auth-dialog .main form .auth-dialog-field .auth-dialog-field .auth-dialog-field-placeholder,.auth-dialog .main form .auth-dialog-field .auth-dialog-field input{cursor:text;font-size:14px}.auth-dialog .main form .auth-dialog-field input{vertical-align:top;width:100%;border:solid 1px #e1e7ef;background:#e1e7ef;line-height:17px;padding:0 9px;height:41px;color:#26282f}.auth-dialog .main form .auth-dialog-field input:hover{background:#e4e9f1}.auth-dialog .main form .auth-dialog-field input:focus,.auth-dialog .main form .auth-dialog-field input.tv-dialog-content-textactive{background:#f4f7fa;border-color:#e1e7ef}.auth-dialog .main form .auth-dialog-field input.error{border-color:#b92f2f}.auth-dialog .main form .auth-dialog-field .auth-dialog-field-placeholder{pointer-events:none;position:absolute;left:11px;top:13px;color:#8891a3}.auth-dialog .main form .auth-dialog-field .auth-dialog-field-placeholder.disabled{display:none}.auth-dialog .main form .auth-dialog-field input:focus+.auth-dialog-field-placeholder{display:none}.auth-dialog .main form .auth-dialog-field input.empty:focus+.auth-dialog-field-placeholder{display:block;color:#a8b1c3}.auth-dialog .main form .auth-dialog-group{overflow:hidden;margin:21px 0}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember{cursor:pointer}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember .auth-dialog-remember-pseudo{position:relative;display:inline-block;height:16px;width:16px;vertical-align:top;overflow:hidden}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember .auth-dialog-remember-pseudo input{position:absolute;visibility:hidden;padding:0;margin:0;width:100%;height:100%}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember .auth-dialog-remember-pseudo input:checked+.auth-dialog-remember-view{background-position:0 -16px}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember .auth-dialog-remember-view{display:block;width:16px;height:16px;background:url(data:image/gif;base64,R0lGODlhEAAgAPABAF24iP///yH5BAUAAAEALAAAAAAQACAAAAI9hI+pq+EPHYo0zAovlmc/vYGYWJGUGaFZ51nMC8fyrH6sV3OGrfUJDwDudEHi0HVsEIVFZDN0gx6ltKqhAAA7) 0 0 no-repeat}.auth-dialog .main form .auth-dialog-group .auth-dialog-remember .auth-dialog-remember-text{font-size:12px;line-height:16px;vertical-align:top;color:#8891a3;margin:0 0 0 6px}.auth-dialog .main form .auth-dialog-group .auth-dialog-recover{cursor:pointer;float:right;color:#0080b7;font-size:12px;line-height:16px;vertical-align:top}.auth-dialog .main form .auth-dialog-submit{margin:34px 0 29px}.auth-dialog .main form .auth-dialog-submit button{cursor:pointer;display:block;margin:0 0 0 auto;border:0;padding:0;height:47px;width:162px;font-size:14px;line-height:normal;text-align:center;font-weight:700;text-transform:uppercase;background-color:#1fb2cc;color:#fff}.auth-dialog .main form .auth-dialog-submit button::-moz-focus-inner{border:0;padding:0}.auth-dialog .main form .auth-dialog-submit button:hover{background:#1eb9d2}.auth-dialog .main form .auth-dialog-submit button.process{background-image:url(images/button-base-process.gif)}.auth-dialog .main form .auth-dialog-notice{color:#8891a3;font-size:12px;line-height:14px;margin:-3px 3px -6px 3px}.auth-dialog .main form .auth-dialog-notice p{margin:0}.auth-dialog .main .auth-dialog-footnote{position:absolute;top:100%;left:0;margin:12px 0 0;font-size:14px;font-weight:700;color:#f2f5f8}.auth-dialog .main .auth-dialog-footnote a{cursor:pointer;color:#24cfed}.auth-dialog h2{color:#26282f;font-size:26px;font-weight:400;margin:24px 0 19px;text-transform:uppercase}.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}.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:0;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 .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:0}.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;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}.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{margin:0 5px 0 0;left:-7px}.tv-dialog-content .dialog-buttons .tv-dialogs-label-hint{float:left;margin-top:7px;margin-left:0}.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}.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-aside{float:left;width:318px;margin:0 0 168px}.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;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;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:0;border-radius:0;box-shadow:none}.prorttrial-dialog .main,.trialconfirm-dialog .main{width:600px;padding:10px 28px 20px}.prorttrial-dialog h3,.trialconfirm-dialog h3{font-size:26px;font-weight:400;text-transform:uppercase;color:#26282f;margin:14px 0 20px}.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;margin:0 auto;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:14px 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 .more-controls,.trialconfirm-dialog .more-controls{overflow:hidden;margin:18px 0 0;text-align:right}.prorttrial-dialog .more-controls a,.trialconfirm-dialog .more-controls a{font-size:16px;color:#007fb9;text-decoration:underline}.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;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 -2156px}.publish-dialog-privacy input:checked+.publish-dialog-privacy-icon{background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2180px}.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 -2132px}#publish-chart-form .publish-text input,#publish-chart-form .publish-text textarea{margin:0;display:block}.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}.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{display:block;padding:7px 30px 7px 7px;height:16px;position:relative}.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.disabled .title-expanded{color:#9d9d9d}.charts-popup-list .item .title{width:140px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.charts-popup-list .item .title-expanded{width:225px;font-weight:400;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.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;font-size:14px}.charts-popup-list .charts-popup-tab-header{float:left;margin:0 10px 5px}.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:0;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: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-itemheader{padding:3px 8px 4px;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:url(images/icons.png);background-position:-80px -100px;top:7px;right:7px;visibility:hidden}.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}/*! 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 -1169px;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:rgba(0,0,0,0);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(css/fancybox/fancybox_overlay.png);cursor:pointer}.fancybox-overlay-fixed{position:fixed;bottom:0;right:0}.fancybox-lock .fancybox-overlay{overflow:auto;overflow-y:scroll}.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 -2870px;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 -2924px;display:block;position:absolute;overflow:hidden;top:50%;left:50%;margin-left:-8px;margin-top:-22px}.header-menu-wrap{height:58px}.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-signup,.header-item-earlyaccess{float:right}.is-not-authenticated .header-menu.header-item-profile,.is-authenticated .header-button.header-item-signin,.is-authenticated .header-button.header-item-signup,.is-pro .header-button.header-item-gopro,.is-not-pro .header-item-profile strong.badge{display:none}.is-trial .header-button.header-item-gopro{display:block}.header-logo{height:32px;margin:13px 30px 0 0}.header-logo:hover{opacity:1!important}.header-logo:hover>a{opacity:.85}.header-menu.header-logo ul{width:192px}.header-menu.header-logo li a{position:relative}.header-menu.header-logo 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 li a[target='_blank']:after{background-image:url(images/external-link/ext-blue.png)}.header-menu.header-logo li a:hover[target='_blank']:after{background-position:0 -10px}.is-not-authenticated .index-page .header-menu.header-logo li a:hover[target='_blank']:after{background-position:0 0}.header-menu.header-logo>a{display:block;height:32px;padding-left:40px;padding-right:17px;background-image:url(images/logo.png);background-position:0 4px;background-repeat:no-repeat;font-size:14px;color:#fff;line-height:32px}.is-not-authenticated .index-page .header-menu.header-logo>a{background-image:url(images/logo-white.png);background-position:0 0}.header-menu a{color:#dbdfeb}.header-menu>a{display:inline-block;height:32px;line-height:32px}.logged-user-menu .header-menu>a{font-size:14px;color:#fff}.header-button,.header-button:link,.header-button:visited{display:block;height:32px;margin-top:13px;padding:0 15px;color:#dbdfeb;font-size:13px;line-height:32px;text-decoration:none}.logged-user-menu .header-button,.logged-user-menu .header-button:link,.logged-user-menu .header-button:visited{font-size:14px;color:#fff}.logged-user-menu .header-button:hover,.logged-user-menu .header-button:link:hover,.logged-user-menu .header-button:visited:hover{color:#58c3e5}.is-not-authenticated .header-button{color:#fff;text-transform:uppercase}.is-not-authenticated .header-button:hover{opacity:.85}.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 -1320px;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 -1723px;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 -1477px;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 -1400px;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 -1268px;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 -1667px;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 -1427px;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 -1346px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button.with-icon:hover{color:#58c3e5}.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 -1294px;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 -1695px;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 -1452px;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 -1373px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.header-button:link.header-item-signin{padding-left:20px;padding-right:25px}.is-not-authenticated .index-page .header-menu.open>a{background-position:0 -32px}.header-button.active,.header-menu.active>a,.ideas-header .header-item-ideas>a,.profile-header .header-item-profile>a{-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box;background:#43444a;color:#fff}.header-menu{position:relative;margin-top:13px;height:32px;-ms-touch-action:none}.header-menu.with-sub>a:after{content:'';background-image:url(images/icons.png);background-position:-80px -40px;background-repeat:no-repeat;display:block;width:10px;height:6px;position:absolute;right:0;top:14px}.header-item-ideas,.header-item-scripts{float:left}.header-item-scripts,.header-item-scripts,.header-item-ideas,.header-item-chart>a{padding-left:35px!important;padding-right:18px!important;position:relative}.header-item-scripts.with-sub,.header-item-ideas.with-sub,.header-item-chart.with-sub>a{padding-right:20px!important}.header-item-scripts:hover,.header-item-scripts:hover>a,.header-item-ideas:hover,.header-item-chart:hover>a,.header-item-scripts.with-sub.open>a,.header-item-ideas.with-sub.open>a,.header-item-chart.with-sub.open>a{color:#58c3e5}.header-item-ideas:before{content:" ";height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1914px;display:block;position:absolute;overflow:hidden;left:10px;top:5px}.header-item-ideas:hover:before,.header-item-ideas.open:before{content:" ";height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1943px;display:block;position:absolute;overflow:hidden}.header-item-scripts:before{content:" ";height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1972px;display:block;position:absolute;overflow:hidden;left:10px;top:6px}.header-item-scripts:hover:before,.header-item-scripts.open:before{content:" ";height:19px;width:17px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2001px;display:block;position:absolute;overflow:hidden}.header-item-chart>a:before{content:" ";height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1864px;display:block;position:absolute;overflow:hidden;left:8px;top:8px}.header-item-chart:hover>a:before,.header-item-chart.open>a:before{content:" ";height:15px;width:21px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1889px;display:block;position:absolute;overflow:hidden}.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;background:#292b32;background:rgba(41,43,50,.97);-webkit-border-radius:0 0 2px 2px;-webkit-background-clip:padding-box;-moz-border-radius:0 0 2px 2px;-moz-background-clip:padding;border-radius:0 0 2px 2px;background-clip:padding-box;-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;box-shadow:none;border:0;border-radius:0 0 4px 4px}.header-menu.to-left ul{left:auto;right:0}.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 .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-item-chart .popup-subblock{width:225px;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 .name,.header-item-chart .subscript{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-item-chart .name{display:block;font-weight:700}.header-item-chart .subscript{display:block;font-size:10px;color:#9e9e9e;height:14px}.header-item-chart span.icon-carousel-item-delete-dark{position:absolute;top:15px;right:10px}.header-item-chart span.icon-carousel-item-delete-dark{visibility:hidden}.header-item-chart li:hover span.icon{visibility:visible}.header-item-chart li:hover span{color:#fff}.is-not-authenticated .index-page .header-search{display:none}.header-search{position:relative}.header-search>div{height:32px;padding:13px 0 0;margin:0 8px 0 20px}.index-page.three-columns .header-search>div{margin:0 8px 0 80px}.header-search input{height:32px;width:115px;margin:0;padding:0 28px 0 8px;font-size:13px;background:#46484e;border:0;color:#d4d4d4;box-shadow:none;-webkit-border-radius:2px;-webkit-background-clip:padding-box;-moz-border-radius:2px;-moz-background-clip:padding;border-radius:2px;background-clip:padding-box;font-family:'Open Sans',sans-serif}.header-search.not-empty input{text-transform:uppercase}.header-search input:focus{color:#fff}.header-search span{top:13px;right:8px;width:20px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -2613px;display:block;position:absolute;overflow:hidden;width:26px;height:32px;cursor:pointer}.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 35px 0 6px;height:32px}.header-menu.header-item-profile>a:after{right:20px}.header-item-profile .user-info-username{display:inline-block;margin:0 3px 0 10px;max-width:120px;font-size:14px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.is-trial .header-item-profile .user-info-username{max-width:80px}.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 -2204px;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 -2229px;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 -2327px;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 -2351px;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 -2686px;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 -2709px;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 -2277px;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 -2302px;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}.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;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 16px;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-authenticated .header-item-gopro-signup{display:none}.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:0;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}.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}.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 ul li span.mark{color:#60b789;font-weight:700}.content-page .separator{margin:45px 0 35px;background:#ccd8e4;height:1px;overflow:hidden}.content-page .vindent{padding:36px 0}.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;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 -3147px;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 -2952px;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 -3371px;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 -3272px;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}.header-chart-panel{display:block;position:relative;min-height:30px;padding:5px 5px 0;overflow:hidden;background-color:#f1f3f6}.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 i{top:-2px;left:-1px;background-position:0 20px}.is-mobile .header-chart-panel .button.compare i{display:block;top:-2px;left:-1px;background-position:-60px -18px}.is-mobile .header-chart-panel .button.indicators i{display:block;top:-2px;background-position:-20px -18px}.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 .right{float:right}.header-chart-panel .left{margin:0 0 -5px 0}.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;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{cursor:default;padding:7px 12px;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 .header-chart-panel .button,.is-mobile .hotlist-controls .button,.is-mobile .symbol-edit-widget .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 .header-chart-panel .button:hover,.is-mobile .hotlist-controls .button:hover,.is-mobile .symbol-edit-widget .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 .header-chart-panel .button:active,.is-mobile .hotlist-controls .button:active,.is-mobile .symbol-edit-widget .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 .header-chart-panel .button.active:hover,.is-mobile .hotlist-controls .button.active:hover,.is-mobile .symbol-edit-widget .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 .header-chart-panel .button.active,.is-mobile .hotlist-controls .button.active,.is-mobile .symbol-edit-widget .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 .header-chart-panel .button .arrow-icon,.is-mobile .hotlist-controls .button .arrow-icon,.is-mobile .symbol-edit-widget .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 .header-chart-panel .button .arrow-icon:before,.is-mobile .hotlist-controls .button .arrow-icon:before,.is-mobile .symbol-edit-widget .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 i{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:25px}.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:101px;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:100px}.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:0}.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{overflow-y:auto;width:550px}table.symbol-edit-popup{width:100%;border-collapse:collapse}table.symbol-edit-popup td{padding:7px}table.symbol-edit-popup td:first-child{padding-left:20px}table.symbol-edit-popup td:last-child{padding-right:20px}tr.symbol-edit-popup{cursor:pointer;height:25px}tr.symbol-edit-popup td:first-child{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{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;margin:0 5px 0 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:0;border-right:0;background:#fff}.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:0}.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 #e5e4e4}.symbol-search-dialog .filter a.type-filter,.symbol-search-dialog .filter .exchange-filter{padding:10px 0;margin-left:20px;display:inline-block;position:relative;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:first-child,.symbol-search-dialog .filter .exchange-filter:first-child{margin-left: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:0;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}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;border-bottom:1px solid #e5e4e4}.symbol-edit-popup .filter a.type-filter,.symbol-edit-popup .filter .exchange-filter{padding:6px 0;margin-left:20px;font-weight:700;font-size:11px;display:inline-block;border-bottom:0;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:first-child,.symbol-edit-popup .filter .exchange-filter:first-child{margin-left: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;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{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;cursor:default}.is-mobile .favored-list-container span{padding:15px 17px 11px;background:#b5b7ba;color:#fff;border:0}.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}.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}.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:#e5e4e4;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 i,.button.redo i{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAPCAYAAADzun+cAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAVRJREFUeNrElbFrAjEUxk8RCt0EBx1FHJy6O1g3BxEEsYt/gFspdD1ucXU5+k8UQQR1FxS6iLtiJ6dCN8Eb7/oFvkCMMVy9wQ9+cJe8vM+Xl4upKIqceyjt3EkZ13Vt848guDG3da2t4hbYJyhqzxyxjbNgBKagkMC4wBwj5rQa18AadLUtu2WbpbrMWTMZi0AfLEBJmU+BE/gFE/ByZZfSnJsw9sS1UiXm9uWPyoAKmGmGunKgTb5AB/xwLg/GoBrjC3oFTdF78bIDH/84vcJgyb5l+VyNuTag104Yh9yCJ7AyBM/BlnFSZTAkZWU8ZOzckGdFD+EVqv36BnXwplXfYjuKYMD+CfWIw7EBYyraZxQwZ50exlNtq/4APPAMjuCBHDnmMeZqlXEuELV6XRvQV977HNN1UeXZlWk5CLJ6kz5BQ3k2ybfe1QlupvckfxJ/AgwAG5ZNUoKsEEMAAAAASUVORK5CYII=)}.button.undo,.button.redo{z-index:2}.button.undo.disabled,.button.redo.disabled{z-index:1}.header-chart-panel .button.redo{left:-1px}.button.redo i{background-position:-15px 0}.button.fullscreen,.header-chart-panel .button.fullscreen{margin-left:4px;padding:5px 6px 9px}.button.fullscreen i{width:18px;height:18px;background-position:-180px -100px}.button.properties i{width:17px;height:17px;background-position:-160px -240px}.button.properties:hover i,.button.properties.active i{background-position:-40px -340px}.button.properties.active i{background-position:0 -440px}.button.alerts i{height:18px;width:20px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1093px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.button.alerts:hover i,.button.alerts.active i{height:18px;width:20px;background-image:url(images/sprites/base-sprite.png);background-repeat:no-repeat;background-position:0 -1065px;display:inline-block;position:relative;vertical-align:middle;overflow:hidden}.button.indicators i{width:17px;height:17px;background-position:-60px -420px}.button.indicators:not(:only-child){border-right:0}.button.indicators.active i{background-position:-93px -440px}.button.compare i{width:17px;height:17px;background-position:-120px -220px}.button.compare.active i{background-position:-126px -439px}.button.script-editor i{width:21px;height:17px;background-position:-38px -420px}.button.script-editor.active i{background-position:-71px -440px}.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 .submenu{border-left-style:dotted;border-left-width:1px}.is-mobile .favored-list-container.study-template-widget .submenu{border-left:0}.favored-list-container.study-template-widget .quick>span{padding:7px 4px}.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}.header-chart-panel .button.published-timeline:not(:only-child){border-right-style:dotted}.header-chart-panel .button.published-timeline i{width:19px;height:19px;background-position:-119px -340px}.header-chart-panel .button.published-timeline:active i,.header-chart-panel .button.published-timeline.active i{background-position:-139px -340px}.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}.chart-style-popup .item{padding:7px 7px 6px;height:18px}.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-widget span{padding:4px 8px 10px}.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}.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}.header-chart-panel .button.eotpro-button .arrow-icon{width:0;height:0;border-style:solid;border-width:5px 4.5px 0;border-color:#fff transparent transparent}#footer-chart-panel{min-height:28px;padding:0 5px 5px;background-color:#f1f3f6;position:relative}.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.getimage,.is-mobile #footer-chart-panel .publish-buttons a.tweetimage,.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage,.is-mobile #footer-chart-panel .publish-buttons a.publish-chart-button{margin-right:30px}.is-mobile #footer-chart-panel .publish-buttons a.getimage .icon,.is-mobile #footer-chart-panel .publish-buttons a.tweetimage .icon,.is-mobile #footer-chart-panel .publish-buttons a.stocktwitimage .icon,.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;background-position:0 0}.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:2px;width:20px;height:17px;background-position:-20px 0}.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:1px;width:20px;height:17px;background-position:-40px 0}.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:3px;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}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:#00b2d0;color:#fff;padding:8px 14px 7px;font-size:12px;font-weight:700;float:left;height:15px;margin:0 0 0 7px}#footer-chart-panel a.publish-chart-button.inprogress{background:#ffb03b}#footer-chart-panel a.getimage,#footer-chart-panel a.tweetimage,#footer-chart-panel a.stocktwitimage{float:left;margin:0 0 0 7px;position:relative}a.getimage{padding:8px 7px 7px;border:0}a.getimage:not([disabled]),a.getimage:active:not([disabled]),a.getimage.active:not([disabled]){background:#5cb888}a.getimage .icon{width:16px;height:13px;background-position:-40px -240px;position:relative;top:-1px}#footer-chart-panel a.tweetimage{padding:8px 5px 7px;background:#00c9ff}#footer-chart-panel a.tweetimage .icon{width:20px;height:16px;background-position:-120px -240px;position:relative;top:-1px}#footer-chart-panel a.stocktwitimage{padding:8px 5px 7px;background:#ae3836}#footer-chart-panel a.stocktwitimage .icon{width:22px;height:14px;background-position:-140px -300px}.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:0;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:0;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{float:right}.publish-buttons .tv-button{border-width:0}.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>span:hover{color:#333}.save-load-buttons>span:active,.save-load-buttons>span.active{background-color:#f4f7f9}.save-load-buttons>span.first{border-left:1px solid #c9cbcd}.save-load-buttons>span.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 .save.titled .separator,.save-load-buttons .copy.titled .separator{display:block}.save-load-buttons .load{border-right:0}.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:0;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:0;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{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}.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:before{content:" ";position:absolute;top:12px;right:7px;width:0;height:0;border-style:solid;border-width:5px 4.5px 0;border-color:#8f9091 transparent transparent}.layout-toggle-container .tv-button.active{background:#f1f3f6!important}.layout-toggle-container .tv-button.active:before{border-width:0 4.5px 5px;border-color:transparent transparent #81bde2}.layout-toggle-container .tv-button i{position:absolute;width:29px;height:23px;top:2px;left:1px;background-image:url(images/bottomtoolbar/layout-buttons.png)}.layout-widget{position:absolute;z-index:120;border:1px solid #c9cbcd;padding:12px 12px 8px;background:#fff;color:#4c5151}.layout-widget .layout-button{display:inline-block;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:31px;height:25px;border:1px solid transparent;background-image:url(images/bottomtoolbar/layout-buttons.png);cursor:pointer}.layout-widget .layout-button.active{border-color:#c9cbcd;background-color:#f2f5f8}.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:0;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 .main{top:3px;left:3px;margin:0;border:0;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;border-color:transparent transparent #c9cbcd;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.hidden{display:none}.tv-side-toolbar.two-column{width:97px}.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}.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{display:block;border:1px solid transparent;cursor:default}.tv-side-toolbar .tools-group .button{height:30px;margin:6px 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:0;width:30px;height:30px}.tv-side-toolbar .tools-group .button .main.text-as-icon{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-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{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,.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 .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;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}.widgetbar-wrap{top:0;right:0;position:absolute;height:100%}.widgetbar-place .widgetbar-wrap{position:fixed;z-index:15}.widgetbar-handle{position:absolute;top:0;left:-3px;height:100%;width:5px;background:rgba(0,0,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}.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-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;width:21px;height:21px;background:url(images/widget-icons.png) 0 0 no-repeat}.widgetbar-icon.active{background-position:-21px 0}.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-group-base{width:27px;height:22px;background-position:0 -234px}.widgetbar-tab.active .widgetpage-icon-group-base{background-position:-27px -234px}.widgetpage-icon-group-chat{width:23px;background-position:0 -261px}.widgetbar-tab.active .widgetpage-icon-group-chat{background-position:-27px -261px}.widgetpage-icon-group-hotlists{height:23px;background-position:0 -285px}.widgetbar-tab.active .widgetpage-icon-group-hotlists{background-position:-27px -285px}.widgetpage-icon-group-notifications{background-position:0 -314px}.widgetbar-tab.active .widgetpage-icon-group-notifications{background-position:-27px -314px}.widgetpage-icon-group-calendar{height:23px;background-position:0 -336px}.widgetbar-tab.active .widgetpage-icon-group-calendar{background-position:-27px -336px}.widgetpage-icon-group-messages{width:23px;background-position:0 -365px}.widgetbar-tab.active .widgetpage-icon-group-messages{background-position:-27px -365px}.widgetpage-icon-group-datawindow{width:23px;background-position:0 -411px}.widgetbar-tab.active .widgetpage-icon-group-datawindow{background-position:-27px -411px}.widgetpage-icon-group-notes{width:26px;height:26px;background-position:0 -461px}.widgetbar-tab.active .widgetpage-icon-group-notes{background-position:-27px -461px}.widgetpage-icon-group-alerts{width:23px;background-position:0 -435px}.widgetbar-tab.active .widgetpage-icon-group-alerts{background-position:-27px -435px}.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;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:0}.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-page{display:none;height:100%}.widgetbar-page.active{display:block}.widgetbar-widget{margin:0 0 1px;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;background:#e8ebed;height:21px;width:21px;margin:7px 0 0 10px;background:url(images/widget-icons.png) 0 0 no-repeat}.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:rgba(0,0,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:rgba(0,0,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:rgba(0,0,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;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 -2052px;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 -2078px;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-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 .icon-detach{width:10px;height:10px;margin:3px 0 2px;background-position:-140px -140px}.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-tabscontrols .widgetbar-chart-helpbutton{margin:5px auto;width:30px;height:30px;background:url(images/help/help-icon-large.png) 50% 50% no-repeat;cursor:pointer}.widgetbar-tabscontrols .widgetbar-chart-helpbutton:hover,.widgetbar-tabscontrols .widgetbar-chart-helpbutton.active{opacity:.8}.properties-toolbar{position:absolute;top:70px;left:40%;height:39px;z-index:15;background:#fff;border:1px solid #c9cbcd;-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:after{clear:both;display:table;content:""}.properties-toolbar>div,.properties-toolbar .tools-group{display:inline-block;float:left}.properties-toolbar>div>div,.properties-toolbar .tools-group>div,.properties-toolbar>div>input,.properties-toolbar .tools-group>input{display:inline-block;float:left}.properties-toolbar .tools-group{position:relative;height:27px;padding:6px 3px}.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>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:-1px}.properties-toolbar .tools-group.properties-tools-group>div:last-child,.properties-toolbar .tools-group.properties-tools-group>span:last-child,.properties-toolbar .tools-group.properties-tools-group>a:last-child,.properties-toolbar .tools-group.properties-tools-group>.colorpicker-widget:last-child{margin-right:3px}.properties-toolbar .tools-group.properties-tools-group .divider{height:27px;width:5px}.properties-toolbar .tools-group .button{width:36px;height:25px;display:inline-block;position:relative}.properties-toolbar .tools-group .button.with-arrow{width:40px}.properties-toolbar .tools-group .button.with-arrow:after{position:relative;top:14px;left:30px;content:" ";width:0;height:0;border-style:solid;border-width:2px 2px 0;border-color:#707275 transparent transparent;border-style:inset}.properties-toolbar .tools-group .button.active:after,.properties-toolbar .tools-group .button:active:after,.properties-toolbar .tools-group .button:focus:after{border-color:#00c3e6 transparent transparent}.properties-toolbar .tools-group .colorpicker-widget{border-color:#c9cbcd;width:40px;height:25px;cursor:default}.properties-toolbar .tools-group .colorpicker-widget[class*=icon-]{background-image:url(images/linetool-properties/colorpicker-icons.png)}.properties-toolbar .tools-group .custom-select .switcher{padding:0;width:40px;min-width:40px;background-color:#fff}.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:9px;top:12px;content:" ";width:0;height:0;border-style:solid;border-width:2px 2px 0;border-color:#707275 transparent transparent;border-style:inset}.properties-toolbar .tools-group .custom-select .switcher:active .icon,.properties-toolbar .tools-group .custom-select .switcher:active .icon{border-color:#00c3e6 transparent transparent}.properties-toolbar .tools-group .custom-select .items{padding:6px 5px;width:auto}.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:25px}.properties-toolbar .tools-group .custom-select .items .item.selected{border:1px solid #c9cbcd}.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}.properties-toolbar .tools-group .custom-select.simple .items .item.selected{border:0;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:39px;width:16px;position:relative}.properties-toolbar .drag-handler i{margin:7px;position:absolute;width:6px;height:26px;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-].icon-pencil{background-position:0 0}.properties-toolbar [class*=icon-].icon-bucket{background-position:0 -25px}.properties-toolbar [class*=icon-].icon-font{background-position:0 -50px}.properties-toolbar [class*=icon-].icon-list{background-position:0 -75px}.properties-toolbar [class*=icon-].icon-line{background-position:0 -100px}.properties-toolbar [class*=icon-].icon-line-left-arrow{background-position:0 -125px}.properties-toolbar [class*=icon-].icon-line-right-arrow{background-position:0 -150px}.properties-toolbar [class*=icon-].icon-line-two-arrow{background-position:0 -175px}.properties-toolbar [class*=icon-].icon-ray-left{background-position:0 -200px}.properties-toolbar [class*=icon-].icon-ray-right{background-position:0 -225px}.properties-toolbar [class*=icon-].icon-ray-segment{background-position:0 -250px}.properties-toolbar [class*=icon-].icon-line-dashed{background-position:0 -275px}.properties-toolbar [class*=icon-].icon-line-dotted{background-position:0 -300px}.properties-toolbar [class*=icon-].icon-line-width-1{background-position:0 -100px}.properties-toolbar [class*=icon-].icon-line-width-2{background-position:0 -325px}.properties-toolbar [class*=icon-].icon-line-width-3{background-position:0 -350px}.properties-toolbar [class*=icon-].icon-line-width-4{background-position:0 -375px}.properties-toolbar [class*=icon-].icon-settings{background-position:0 -400px}.properties-toolbar [class*=icon-].icon-clone{background-position:0 -425px}.properties-toolbar [class*=icon-].icon-remove{background-position:0 -450px}.properties-toolbar [class*=icon-].icon-hide{background-position:0 -475px}.properties-toolbar [class*=icon-].icon-zorder{background-position:0 -500px}.properties-toolbar [class*=icon-].icon-line-left-normal{background-position:0 -525px}.properties-toolbar [class*=icon-].icon-line-right-normal{background-position:0 -550px}.properties-toolbar [class*=icon-].icon-line-left-extend{background-position:0 -575px}.properties-toolbar [class*=icon-].icon-line-right-extend{background-position:0 -600px}.properties-toolbar [class*=icon-].icon-lock{background-position:0 -625px}.properties-toolbar [class*=icon-].active.icon-pencil,.properties-toolbar [class*=icon-]:active.icon-pencil,.properties-toolbar [class*=icon-]:focus.icon-pencil{background-position:-40px 0}.properties-toolbar [class*=icon-].active.icon-bucket,.properties-toolbar [class*=icon-]:active.icon-bucket,.properties-toolbar [class*=icon-]:focus.icon-bucket{background-position:-40px -25px}.properties-toolbar [class*=icon-].active.icon-font,.properties-toolbar [class*=icon-]:active.icon-font,.properties-toolbar [class*=icon-]:focus.icon-font{background-position:-40px -50px}.properties-toolbar [class*=icon-].active.icon-list,.properties-toolbar [class*=icon-]:active.icon-list,.properties-toolbar [class*=icon-]:focus.icon-list{background-position:-40px -75px}.properties-toolbar [class*=icon-].active.icon-line,.properties-toolbar [class*=icon-]:active.icon-line,.properties-toolbar [class*=icon-]:focus.icon-line{background-position:-40px -100px}.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 -125px}.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 -150px}.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 -175px}.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 -200px}.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 -225px}.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 -250px}.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 -275px}.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 -300px}.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 -100px}.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 -325px}.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 -350px}.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 -375px}.properties-toolbar [class*=icon-].active.icon-settings,.properties-toolbar [class*=icon-]:active.icon-settings,.properties-toolbar [class*=icon-]:focus.icon-settings{background-position:-40px -400px}.properties-toolbar [class*=icon-].active.icon-clone,.properties-toolbar [class*=icon-]:active.icon-clone,.properties-toolbar [class*=icon-]:focus.icon-clone{background-position:-40px -425px}.properties-toolbar [class*=icon-].active.icon-remove,.properties-toolbar [class*=icon-]:active.icon-remove,.properties-toolbar [class*=icon-]:focus.icon-remove{background-position:-40px -450px}.properties-toolbar [class*=icon-].active.icon-hide,.properties-toolbar [class*=icon-]:active.icon-hide,.properties-toolbar [class*=icon-]:focus.icon-hide{background-position:-40px -475px}.properties-toolbar [class*=icon-].active.icon-zorder,.properties-toolbar [class*=icon-]:active.icon-zorder,.properties-toolbar [class*=icon-]:focus.icon-zorder{background-position:-40px -500px}.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 -525px}.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 -550px}.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 -575px}.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 -600px}.properties-toolbar [class*=icon-].active.icon-lock,.properties-toolbar [class*=icon-]:active.icon-lock,.properties-toolbar [class*=icon-]:focus.icon-lock{background-position:-40px -625px}.properties-toolbar .active [class*=icon-].icon-pencil,.properties-toolbar .selected [class*=icon-].icon-pencil{background-position:-40px 0}.properties-toolbar .active [class*=icon-].icon-bucket,.properties-toolbar .selected [class*=icon-].icon-bucket{background-position:-40px -25px}.properties-toolbar .active [class*=icon-].icon-font,.properties-toolbar .selected [class*=icon-].icon-font{background-position:-40px -50px}.properties-toolbar .active [class*=icon-].icon-list,.properties-toolbar .selected [class*=icon-].icon-list{background-position:-40px -75px}.properties-toolbar .active [class*=icon-].icon-line,.properties-toolbar .selected [class*=icon-].icon-line{background-position:-40px -100px}.properties-toolbar .active [class*=icon-].icon-line-left-arrow,.properties-toolbar .selected [class*=icon-].icon-line-left-arrow{background-position:-40px -125px}.properties-toolbar .active [class*=icon-].icon-line-right-arrow,.properties-toolbar .selected [class*=icon-].icon-line-right-arrow{background-position:-40px -150px}.properties-toolbar .active [class*=icon-].icon-line-two-arrow,.properties-toolbar .selected [class*=icon-].icon-line-two-arrow{background-position:-40px -175px}.properties-toolbar .active [class*=icon-].icon-ray-left,.properties-toolbar .selected [class*=icon-].icon-ray-left{background-position:-40px -200px}.properties-toolbar .active [class*=icon-].icon-ray-right,.properties-toolbar .selected [class*=icon-].icon-ray-right{background-position:-40px -225px}.properties-toolbar .active [class*=icon-].icon-ray-segment,.properties-toolbar .selected [class*=icon-].icon-ray-segment{background-position:-40px -250px}.properties-toolbar .active [class*=icon-].icon-line-dashed,.properties-toolbar .selected [class*=icon-].icon-line-dashed{background-position:-40px -275px}.properties-toolbar .active [class*=icon-].icon-line-dotted,.properties-toolbar .selected [class*=icon-].icon-line-dotted{background-position:-40px -300px}.properties-toolbar .active [class*=icon-].icon-line-width-1,.properties-toolbar .selected [class*=icon-].icon-line-width-1{background-position:-40px -100px}.properties-toolbar .active [class*=icon-].icon-line-width-2,.properties-toolbar .selected [class*=icon-].icon-line-width-2{background-position:-40px -325px}.properties-toolbar .active [class*=icon-].icon-line-width-3,.properties-toolbar .selected [class*=icon-].icon-line-width-3{background-position:-40px -350px}.properties-toolbar .active [class*=icon-].icon-line-width-4,.properties-toolbar .selected [class*=icon-].icon-line-width-4{background-position:-40px -375px}.properties-toolbar .active [class*=icon-].icon-settings,.properties-toolbar .selected [class*=icon-].icon-settings{background-position:-40px -400px}.properties-toolbar .active [class*=icon-].icon-clone,.properties-toolbar .selected [class*=icon-].icon-clone{background-position:-40px -425px}.properties-toolbar .active [class*=icon-].icon-remove,.properties-toolbar .selected [class*=icon-].icon-remove{background-position:-40px -450px}.properties-toolbar .active [class*=icon-].icon-hide,.properties-toolbar .selected [class*=icon-].icon-hide{background-position:-40px -475px}.properties-toolbar .active [class*=icon-].icon-zorder,.properties-toolbar .selected [class*=icon-].icon-zorder{background-position:-40px -500px}.properties-toolbar .active [class*=icon-].icon-line-left-normal,.properties-toolbar .selected [class*=icon-].icon-line-left-normal{background-position:-40px -525px}.properties-toolbar .active [class*=icon-].icon-line-right-normal,.properties-toolbar .selected [class*=icon-].icon-line-right-normal{background-position:-40px -550px}.properties-toolbar .active [class*=icon-].icon-line-left-extend,.properties-toolbar .selected [class*=icon-].icon-line-left-extend{background-position:-40px -575px}.properties-toolbar .active [class*=icon-].icon-line-right-extend,.properties-toolbar .selected [class*=icon-].icon-line-right-extend{background-position:-40px -600px}.properties-toolbar .active [class*=icon-].icon-lock,.properties-toolbar .selected [class*=icon-].icon-lock{background-position:-40px -625px}.mini-widget{overflow:hidden;color:#5b5e61;background-color:#fff}.tv-mediumwidget{background-color:#fff;overflow:hidden}#miniwidget .tabs,.tv-mediumwidget .tv-mediumwidget-labels{border-bottom:1px solid #dde1e6}.mini-widget .tab,.tv-mediumwidget .tv-mediumwidget-label{margin:1px 1px 0;padding:8px 10px;display:inline-block;cursor:pointer;font-size:11px;font-weight:700;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.mini-widget .tab.active,.tv-mediumwidget .tv-mediumwidget-label.active{margin:0 0 -1px 0;border-style:solid;border-color:#dde1e6;border-bottom-color:#fff;border-width:1px}.mini-widget .tab.active a,.tv-mediumwidget .tv-mediumwidget-label a{color:#5b5e61}.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:0}.mini-widget .graph>div{height:100%}.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 #e5e4e4;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 #e5e4e4;border-right:1px solid #e5e4e4}.tv-mediumwidget .tv-mediumwidget-pages .tv-mediumwidget-page{display:none}.tv-mediumwidget .tv-mediumwidget-pages .tv-mediumwidget-page.active{display:block}.tv-mediumwidget .footer{border:1px solid #e5e4e4;border-top:0}.tv-mediumwidget .ticker-fundamental-container{width:100%}.tv-mediumwidget .ticker-fundamental-container .fundamentals-cell{vertical-align:top}.tv-mediumwidget .tv-mediumwidget-ticker,.tv-mediumwidget .tv-mediumwidget-fundamentals{height:97px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:15px 15px 0;position:relative}.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 .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 #e5e4e4;text-align:left;color:#878c94;padding-right:5px}.tv-mediumwidget .tv-mediumwidget-fundamentals table td.fundamental-value{width:24%;border-bottom:1px solid #e5e4e4;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:0}.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:#e5e4e4}.tv-mediumwidget .tv-mediumwidget-minichart{float:left;width:100%;margin-top:10px}.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:0;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:0;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;white-space:nowrap;margin:0;padding:0;z-index:3;position:absolute;font-size:9pt;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;margin-left:5px}.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-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}.main .pane-legend-icon-container{top:1px}.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}tr.context-menu.disabled{color:#9d9d9d}tr.context-menu.spinner>td{background:url(images/loading-small.gif) center center no-repeat;cursor:default}.submenu.top{background-image:url(chart-client/css/images/contextmenu_top.png);background-repeat:x-repeat;background-position:top;padding-top:3px}.submenu.left{background-image:url(chart-client/css/images/contextmenu_left.png);background-repeat:y-repeat;background-position:left}.submenu.right{background-image:url(chart-client/css/images/contextmenu_right.png);background-repeat:y-repeat;background-position:right}.submenu.bottom{background-image:url(chart-client/css/images/contextmenu_bottom.png);background-repeat:x-repeat;background-position:bottom}.submenu.center{background-color:#fff}.context-menu{font-size:8.5pt;white-space:nowrap}.context-submenu-arrow{position:absolute;background:url(chart-client/css/images/contextmenu_lefttop.png) 0 -10px no-repeat;width:11px;height:21px;top:7px;left:-10px}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}.edit-panel{z-index:4;font-family:Verdana;font-size:9pt;padding-left:4px}.edit-panel-toolbar{background:#fff}.edit-panel.top{background-image:url(chart-client/css/images/edittoolbar_top.png);background-repeat:repeat-x;background-position:top}.edit-panel.left{background-image:url(chart-client/css/images/edittoolbar_left.png);background-repeat:repeat-y;background-position:left}.edit-panel.right{background-image:url(chart-client/css/images/edittoolbar_right.png);background-repeat:repeat-y;background-position:right}.edit-panel.bottom{background-image:url(chart-client/css/images/edittoolbar_bottom.png);background-repeat:repeat-x;background-position:bottom}.edit-panel .left-arrow{background:url(chart-client/css/images/contextmenu_lefttop.png) 0 -7px;width:12px;height:23px;position:absolute;left:-5px}.edit-panel-buttons{padding-left:3px;padding-right:3px;padding-top:1px;padding-bottom:1px}.edit-panel-toolbar{padding-left:0;padding-right:0}.edit-panel-editors{padding-left:6px;padding-top:3px;padding-bottom:3px;padding-right:6px}.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-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}.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}.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:0 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}.tvcolorpicker-user-swatches{margin:6px 0 0}.some-colorpicker .tvcolorpicker-widget{margin-right:8px}.properties-tabs{padding:0 25px;border-bottom:1px solid #e5e4e4}.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:-65px;left:50%;position:absolute;bottom:27px;width:135px;height:25px;z-index:13}.control-bar span{display:block;float:left;width:25px;height:25px;padding-left:0;margin-left:1px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAAZCAQAAAAIn+aWAAAMP0lEQVR4Ae2b8VNTVxbHzw9rd6udquN0xkqn3U2nM3bs6DjbTjtj25UpIUgwQAn7EAIFqyBFFeRht61FBqRAgGAAZKtaCHkhAIOSglTS6aqsVERcpKPrtOx0WesmJDHon9Cc4oPkHd41P4Tf3v1OZnjhfnLeD+c7597z7gMyVsE6iII/gSrwiQr8vRLkhkK8AFshFvTABT6xgb83KITs2ARxkANFwAc+ORAHGxVi6bEWXgAVURSsVggyNoEGOKJY2KgQZGyH3cAT5cA2hQgdK2ADJt7Brd++N63z6x+l+vTTum+i92/Bb+F5WKEQC+MZeA8TT5/XWTpV52mZa3U3T9V3HE3Kw28hGlYpxMJYB1mYeNGV1V8OCBM9U73jPQNCZeu7lfgtZMBahRDHU/ASqAyb72gf6v2JvgSf1qv1aX0J/sSH+skd+tdABS8+TkaFWA3JwMXsuVbtb/GZvQ0eE8rb4DP7W65Uvb0bONgJzyoEDlgPB4F/o7zLMtkzYR/vHLOhxjsn7JM91vbNZcBDPjynEDhWYCKa3vTrH+i88bMat9qldsW41O7YWY033q/z6Y+/DpiMvwOFeAYTsfiQp9ln9tS7je4aV42r2lUT+MvoqfeZ3c379gMHOlgJCrEOEzGjbqLnhv2aMGodtVy1jAQ+ox2j1mtCIDV73jcCDwWwBhQCl2Mn3nyk9yX8loYxwXKrZ+N8CXP6akzG55ePcOkiEWP5CVyOlRTOnfQ2/JaG1cFy18zWehv8LQUHgYPty0e4TkQkxvITWcBn1t/qHe/ENBwJ0ahlVBjvnOxJxWRMXz7ie3skYiw/sRaXY/5AIro1mHxE6lmNL8GjT9wEKlgdGcKp4/dkFKbwhkNH9lzVumJmYovzIh1jWYhNuBzzNGMiuqqpsC54G1zNb+HSbGNkiKvmciG3z+DY11dpnTC5qu8Zy2yRjrEsxHZcjk30BBKxY8RChHXBOt55vXsTLs22RYboth8ZzL7IOXMufjLQbxuxXO4oGYx0jGUhsC94R/tANytJxF/U5Vl3NY+TMc6vm4zHfiElqNjEjLoqM4VfVOphc/qhvBT+yTHm54cTA3VXcyx7JrS6MYmjOT/HBs/GSITQAHet2meWJuL9GnPb9Px3gZrgM1+pAg7UlKBiE/dqWs5mOgwLyu5vP/W5zeB4coz5+eHEQE0bTe33Qqsbk6i1zATFwmiUwL5gl+WGfdQqTcIKh9P6OBmFCbu1HfuFlKBiE5ctX/SnObkFZThNfYcH05xPjjE/P5wYKKe1zHFZZMMgSh2XgqyI0SixCvuCD/Xe+NDl2K24/PwUHk2Icqu98Q/1edgvXEkJKhbxyW60UnmWUzejvqgrzxLNKE9QE7JjiCZM4ffl39wR3l3hr+cW3IgPjkaIKOwL+ls89aHLsTt1R+wGx7RRXJp56v0nE3KBgw2UoGIRVRaDI9NhbrtqvlczYja3iYaUJ6gJ2TFEExocJfbb9eHdFf56cfcP9cHRCLER+4KTPdeE0OXYkHBgiHM6reLS7Jow2bvtOPCwkRJULOLTrzlnmrPC0W2/bLHbKxyiIeUJakJ2DNGEnHP/0AUhvLvCX//om0EhOBoh4DlQDUf7E0Or2kASLhZFE6JmNf7Eb6JBBesIQcUg+pKx9g0lirNm1Gh2lBwhb0IWgSbE2emF55PDI3D2rqK+5MVohHgdOOFzaVW71IiLRdGEKLfRZ+44ChxsJQQVg3A2Ye27YhZn3atBs6PkCHkTsgg0Ic7O7fu2KTwCZ3/Y52xajEaIBOC/+PuEpKp1duFiUTQhatQ6Ya9sBR7iCEHFIDq6sfbZ7eKsyxY0O0qGYJiQTTitODt72NodHoGzM4c7uhejEQKXZP9N8iUEVxxzur44hQ81oTvWlzCtw2UZIagYRGFuCl+XsWjBor1iJZQhWCZkEKIJUQ0Z4RDi7FqDeE2IHcDdDbTkgytO+6kP+g0OqQm9DVP1+ACbEFQMotRmcJw+s2jBMgHjoGQIlgkZhGhCrLpfnQqHEO/jyzPiNSH2Aj8caMkHVxxTXzqme6gJO8Y7BwRclhGCikEUD3JO4/lFC5YEruclQ7BMyCBEE2LVre8LhxDvo/q8eE0IPKbl13u12JpHTWtK9mAqEhOqfVqPHlTwx1ACZ1HJE2lFKfx1LbFs5GIQE6KK9k5rmDFCohTm3tXgNSH+Cpy3xWPC1jzqZ2OFFVNRakJXTWBOM3CQEkrgLCp54sNzBsctE7Fs5GIQE6LKhJ+NzBghUUpt00a8JkQx8Dd7xmzYmkd91/HxAKai1IRXLWO2693AQ2EogbOo5InMYc45YCOWjVwMYkJUyeB3HYwYkijFg04rXhMCVH94+VGqd8EW2CKhJkR5tY9SQQUvhxAMg1ACmz343xlSQyMZg5oQVZDHiEGi5OfjnRKC+/2uuZOeBVtgi4SaEOUxzbUCB2khBMsghMBmD/4X2yVEEYtBTYj6xM6IQaIcseOdEoJf8fGt3rEFWxzGykRMiBqzTfUCD0dCCIZBKCHOv0zsF8kY1ISowguMGCTKgSG8JoS0HtyOK8yVq4SzKeFWKXkivZBWwkjHoCY8kHc7jhUDFWzYW3F4TQhJPfixttQmVwnvNwEHyeFUKXkit49WwkjHoCb8rPPHWlYMVLBh79ThNSEk9WBYKB6Uq4TfYz04GE6VkieyGZUwUjGoCYsGhwVWDFSwYYcEvCYE4M5IF7r7MmVQE+LO6D/iXooQEjGIw4E9YEVWeARjT8ggqAlrDUxCYsJqwy+PrU+IOOD+Ldl9nTmNHUu6J/xhfmdECCIGgXvAxq/CJ9h7QgaBJpTs8tiEOLv17P3H1ifEHuAvSnZftefSltwTDs7vjAhBxCD4gMWP94dPsPeELMJple7y2IQ4u4ruCUUCe4RXYqR9yPPJjO4oIYgYhCMJfze4Y3lzB5tgmZAStDval8wkJN3RrvfZ3dFzZdI+5LdNjO4oIYgYxHeN2CoJ7ljermcTbBMSgnRHnU1MQtIdHWpmdEe1wJ84Je1DWrsZ3VFCEDEIWxe2SoI7lhcENsE0ISVId7Sjm0lIuqNtPazu6DOg2r9lqeeEH+2TPifM2YxPywhBxCaO5mC6H8seSLodN5B0LBufGf6iZhCyJmQT9Dkhm6DPCQnxEnBJSz4n/Bt5TrhjLz4tIwQRm6i1YLqb2i81/lh7qdHUbnCY2+7XMAhZE7IJ+pyQTdDnhITYAvy7Sz4nPHRB+pzwrQp8WkYIIjZR6sB0L3N0dg0LnV1lgasKB4NgmJBN0OeEbII+JyQEAESBairev8SJmcqQEzNTWsAlGSGImAT+bl2Gvjj0xAyLkDMhm0ATlmdJWkBM4nPJ+RqMRIhY4Eaqljox03w2+MTMCJ4biSEEEZvA3z195oP+0BMzLELOhGwCTWhuk7SAmESd5HwNRiJEDvBC+1KVrbI/+MSMYAEestiEKDZhPJ8uOTHDIuRMyCbQhBXkxAyLKJXMxkiEgDWg0r/mw0PMzBOU8XiCck1kiH/sPJa9Lz+tKD+/7IOr2ojFWH7iVeDe3u1+wglKd/MbOcDBq5Ehxk6Y2kvsH547Yj/RNmGKWIzlJ94BfnPZOJ6gtMqfoBzvfvUY8PBOZIg+e5lj/1Dm8IGhcke/LVIxlp/A8Tyoql9nv0tw9M+ggvWgENHAFRxkv0uwuwA4+AsoRAbwqUb2uwQ7q4GHXaAQsAJexGT06f3zb9XFYkK68a26OK820LrQl4lv1SnEKtBhMrrFt+qM4lt1s7Uek8/8/6a9+FadFlaCQqyFAkzG8Z6J+bfqOhbeqhPGbIHvuhONwEMerFEIHE/Bi7g0m9zxUO9PEt8vf7DTn/RIfyMuflPQ++UKsRp0uDS7UuU/6WtceL/8xIPGuZPO47gcg4TH75crxHoowKWZtX2y92bX/Pvl123j9ptdt3pPn8XlGOyD5xRCHCtwaQaqvC0Xon/Szb7/KNWd/FPC19sNm/FbWB9UCxRiFS7NgEvIbftsqvZ+41zr/8z/qj3zacwe4ACXY08rRFBNyAAe+G3Hy1u/Fr7vmur9p/28cOzkG+X4LeyCZxUidKzGfiHRBqDTFWIjqIEjeg9eUQgytmG/kCgL3lKIpcdKWAdR8BKoAp+owN9Py85UiPWwFdSQDBwkQQxsgfUKITteAQ3kwEHg4QBkgXrRsgrxK84bLry508i/AAAAAElFTkSuQmCC);cursor:pointer}.control-bar span.disabled{opacity:.5;cursor:default}span.move-left-button-control-bar,span.move-left-button-control-bar.disabled:hover,span.move-left-button-control-bar.disabled:active{background-position:0 0}span.zoom-out-right-button-control-bar,span.zoom-out-right-button-control-bar.disabled:hover,span.zoom-out-right-button-control-bar.disabled:active{background-position:-25px 0}span.turn-button-control-bar,span.turn-button-control-bar.disabled:hover,span.turn-button-control-bar.disabled:active{background-position:-50px 0}span.zoom-in-button-control-bar,span.zoom-in-button-control-bar.disabled:hover,span.zoom-in-button-control-bar.disabled:active{background-position:-75px 0}span.move-right-button-control-bar,span.move-right-button-control-bar.disabled:hover,span.move-right-button-control-bar.disabled:active{background-position:-100px 0}span.move-left-button-control-bar:hover{background-position:-150px 0}span.zoom-out-right-button-control-bar:hover{background-position:-175px 0}span.turn-button-control-bar:hover{background-position:-200px 0}span.zoom-in-button-control-bar:hover{background-position:-225px 0}span.move-right-button-control-bar:hover{background-position:-250px 0}span.back-to-present:hover{background-position:-275px 0}span.move-left-button-control-bar:active{background-position:-300px 0}span.zoom-out-right-button-control-bar:active{background-position:-325px 0}span.turn-button-control-bar:active{background-position:-350px 0}span.zoom-in-button-control-bar:active{background-position:-375px 0}span.move-right-button-control-bar:active{background-position:-400px 0}span.back-to-present:active{background-position:-425px 0}span.back-to-present{display:block;width:25px;height:25px;position:absolute;right:2px;bottom:27px;padding-left:0;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAAZCAQAAAAIn+aWAAAMP0lEQVR4Ae2b8VNTVxbHzw9rd6udquN0xkqn3U2nM3bs6DjbTjtj25UpIUgwQAn7EAIFqyBFFeRht61FBqRAgGAAZKtaCHkhAIOSglTS6aqsVERcpKPrtOx0WesmJDHon9Cc4oPkHd41P4Tf3v1OZnjhfnLeD+c7597z7gMyVsE6iII/gSrwiQr8vRLkhkK8AFshFvTABT6xgb83KITs2ARxkANFwAc+ORAHGxVi6bEWXgAVURSsVggyNoEGOKJY2KgQZGyH3cAT5cA2hQgdK2ADJt7Brd++N63z6x+l+vTTum+i92/Bb+F5WKEQC+MZeA8TT5/XWTpV52mZa3U3T9V3HE3Kw28hGlYpxMJYB1mYeNGV1V8OCBM9U73jPQNCZeu7lfgtZMBahRDHU/ASqAyb72gf6v2JvgSf1qv1aX0J/sSH+skd+tdABS8+TkaFWA3JwMXsuVbtb/GZvQ0eE8rb4DP7W65Uvb0bONgJzyoEDlgPB4F/o7zLMtkzYR/vHLOhxjsn7JM91vbNZcBDPjynEDhWYCKa3vTrH+i88bMat9qldsW41O7YWY033q/z6Y+/DpiMvwOFeAYTsfiQp9ln9tS7je4aV42r2lUT+MvoqfeZ3c379gMHOlgJCrEOEzGjbqLnhv2aMGodtVy1jAQ+ox2j1mtCIDV73jcCDwWwBhQCl2Mn3nyk9yX8loYxwXKrZ+N8CXP6akzG55ePcOkiEWP5CVyOlRTOnfQ2/JaG1cFy18zWehv8LQUHgYPty0e4TkQkxvITWcBn1t/qHe/ENBwJ0ahlVBjvnOxJxWRMXz7ie3skYiw/sRaXY/5AIro1mHxE6lmNL8GjT9wEKlgdGcKp4/dkFKbwhkNH9lzVumJmYovzIh1jWYhNuBzzNGMiuqqpsC54G1zNb+HSbGNkiKvmciG3z+DY11dpnTC5qu8Zy2yRjrEsxHZcjk30BBKxY8RChHXBOt55vXsTLs22RYboth8ZzL7IOXMufjLQbxuxXO4oGYx0jGUhsC94R/tANytJxF/U5Vl3NY+TMc6vm4zHfiElqNjEjLoqM4VfVOphc/qhvBT+yTHm54cTA3VXcyx7JrS6MYmjOT/HBs/GSITQAHet2meWJuL9GnPb9Px3gZrgM1+pAg7UlKBiE/dqWs5mOgwLyu5vP/W5zeB4coz5+eHEQE0bTe33Qqsbk6i1zATFwmiUwL5gl+WGfdQqTcIKh9P6OBmFCbu1HfuFlKBiE5ctX/SnObkFZThNfYcH05xPjjE/P5wYKKe1zHFZZMMgSh2XgqyI0SixCvuCD/Xe+NDl2K24/PwUHk2Icqu98Q/1edgvXEkJKhbxyW60UnmWUzejvqgrzxLNKE9QE7JjiCZM4ffl39wR3l3hr+cW3IgPjkaIKOwL+ls89aHLsTt1R+wGx7RRXJp56v0nE3KBgw2UoGIRVRaDI9NhbrtqvlczYja3iYaUJ6gJ2TFEExocJfbb9eHdFf56cfcP9cHRCLER+4KTPdeE0OXYkHBgiHM6reLS7Jow2bvtOPCwkRJULOLTrzlnmrPC0W2/bLHbKxyiIeUJakJ2DNGEnHP/0AUhvLvCX//om0EhOBoh4DlQDUf7E0Or2kASLhZFE6JmNf7Eb6JBBesIQcUg+pKx9g0lirNm1Gh2lBwhb0IWgSbE2emF55PDI3D2rqK+5MVohHgdOOFzaVW71IiLRdGEKLfRZ+44ChxsJQQVg3A2Ye27YhZn3atBs6PkCHkTsgg0Ic7O7fu2KTwCZ3/Y52xajEaIBOC/+PuEpKp1duFiUTQhatQ6Ya9sBR7iCEHFIDq6sfbZ7eKsyxY0O0qGYJiQTTitODt72NodHoGzM4c7uhejEQKXZP9N8iUEVxxzur44hQ81oTvWlzCtw2UZIagYRGFuCl+XsWjBor1iJZQhWCZkEKIJUQ0Z4RDi7FqDeE2IHcDdDbTkgytO+6kP+g0OqQm9DVP1+ACbEFQMotRmcJw+s2jBMgHjoGQIlgkZhGhCrLpfnQqHEO/jyzPiNSH2Aj8caMkHVxxTXzqme6gJO8Y7BwRclhGCikEUD3JO4/lFC5YEruclQ7BMyCBEE2LVre8LhxDvo/q8eE0IPKbl13u12JpHTWtK9mAqEhOqfVqPHlTwx1ACZ1HJE2lFKfx1LbFs5GIQE6KK9k5rmDFCohTm3tXgNSH+Cpy3xWPC1jzqZ2OFFVNRakJXTWBOM3CQEkrgLCp54sNzBsctE7Fs5GIQE6LKhJ+NzBghUUpt00a8JkQx8Dd7xmzYmkd91/HxAKai1IRXLWO2693AQ2EogbOo5InMYc45YCOWjVwMYkJUyeB3HYwYkijFg04rXhMCVH94+VGqd8EW2CKhJkR5tY9SQQUvhxAMg1ACmz343xlSQyMZg5oQVZDHiEGi5OfjnRKC+/2uuZOeBVtgi4SaEOUxzbUCB2khBMsghMBmD/4X2yVEEYtBTYj6xM6IQaIcseOdEoJf8fGt3rEFWxzGykRMiBqzTfUCD0dCCIZBKCHOv0zsF8kY1ISowguMGCTKgSG8JoS0HtyOK8yVq4SzKeFWKXkivZBWwkjHoCY8kHc7jhUDFWzYW3F4TQhJPfixttQmVwnvNwEHyeFUKXkit49WwkjHoCb8rPPHWlYMVLBh79ThNSEk9WBYKB6Uq4TfYz04GE6VkieyGZUwUjGoCYsGhwVWDFSwYYcEvCYE4M5IF7r7MmVQE+LO6D/iXooQEjGIw4E9YEVWeARjT8ggqAlrDUxCYsJqwy+PrU+IOOD+Ldl9nTmNHUu6J/xhfmdECCIGgXvAxq/CJ9h7QgaBJpTs8tiEOLv17P3H1ifEHuAvSnZftefSltwTDs7vjAhBxCD4gMWP94dPsPeELMJple7y2IQ4u4ruCUUCe4RXYqR9yPPJjO4oIYgYhCMJfze4Y3lzB5tgmZAStDval8wkJN3RrvfZ3dFzZdI+5LdNjO4oIYgYxHeN2CoJ7ljermcTbBMSgnRHnU1MQtIdHWpmdEe1wJ84Je1DWrsZ3VFCEDEIWxe2SoI7lhcENsE0ISVId7Sjm0lIuqNtPazu6DOg2r9lqeeEH+2TPifM2YxPywhBxCaO5mC6H8seSLodN5B0LBufGf6iZhCyJmQT9Dkhm6DPCQnxEnBJSz4n/Bt5TrhjLz4tIwQRm6i1YLqb2i81/lh7qdHUbnCY2+7XMAhZE7IJ+pyQTdDnhITYAvy7Sz4nPHRB+pzwrQp8WkYIIjZR6sB0L3N0dg0LnV1lgasKB4NgmJBN0OeEbII+JyQEAESBairev8SJmcqQEzNTWsAlGSGImAT+bl2Gvjj0xAyLkDMhm0ATlmdJWkBM4nPJ+RqMRIhY4Eaqljox03w2+MTMCJ4biSEEEZvA3z195oP+0BMzLELOhGwCTWhuk7SAmESd5HwNRiJEDvBC+1KVrbI/+MSMYAEestiEKDZhPJ8uOTHDIuRMyCbQhBXkxAyLKJXMxkiEgDWg0r/mw0PMzBOU8XiCck1kiH/sPJa9Lz+tKD+/7IOr2ojFWH7iVeDe3u1+wglKd/MbOcDBq5Ehxk6Y2kvsH547Yj/RNmGKWIzlJ94BfnPZOJ6gtMqfoBzvfvUY8PBOZIg+e5lj/1Dm8IGhcke/LVIxlp/A8Tyoql9nv0tw9M+ggvWgENHAFRxkv0uwuwA4+AsoRAbwqUb2uwQ7q4GHXaAQsAJexGT06f3zb9XFYkK68a26OK820LrQl4lv1SnEKtBhMrrFt+qM4lt1s7Uek8/8/6a9+FadFlaCQqyFAkzG8Z6J+bfqOhbeqhPGbIHvuhONwEMerFEIHE/Bi7g0m9zxUO9PEt8vf7DTn/RIfyMuflPQ++UKsRp0uDS7UuU/6WtceL/8xIPGuZPO47gcg4TH75crxHoowKWZtX2y92bX/Pvl123j9ptdt3pPn8XlGOyD5xRCHCtwaQaqvC0Xon/Szb7/KNWd/FPC19sNm/FbWB9UCxRiFS7NgEvIbftsqvZ+41zr/8z/qj3zacwe4ACXY08rRFBNyAAe+G3Hy1u/Fr7vmur9p/28cOzkG+X4LeyCZxUidKzGfiHRBqDTFWIjqIEjeg9eUQgytmG/kCgL3lKIpcdKWAdR8BKoAp+owN9Py85UiPWwFdSQDBwkQQxsgfUKITteAQ3kwEHg4QBkgXrRsgrxK84bLry508i/AAAAAElFTkSuQmCC);background-position:-125px 0;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;z-index:13}span.back-to-present.hidden{display:none}.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;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;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;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;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;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,.tv-dialog .button,.header-chart-panel .favored-list-container span,.properties-toolbar .favored-list-container span,.tv-dialog .favored-list-container span,.header-chart-panel .submenu,.properties-toolbar .submenu,.tv-dialog .submenu,.header-chart-panel .custom-select .switcher,.properties-toolbar .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,.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,.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,.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,.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),.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,.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):hover,.properties-toolbar .tv-button:not(.ok):not(.cancel):not(.disabled):hover,.tv-dialog .tv-button:not(.ok):not(.cancel):not(.disabled):hover,.header-chart-panel .tv-select-container:not(.sbHolderDisabled):hover,.properties-toolbar .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:0;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}.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-left:1px solid #9c9c9c;border-right:1px solid #9c9c9c;background:#f6f6f6;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMSAxIiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJub25lIj48bGluZWFyR3JhZGllbnQgaWQ9ImdyYWQtdWNnZy1nZW5lcmF0ZWQiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iMCUiIHkxPSIwJSIgeDI9IjAlIiB5Mj0iMTAwJSI+PHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+PHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjZWVlZWVlIiBzdG9wLW9wYWNpdHk9IjEiLz48L2xpbmVhckdyYWRpZW50PjxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+PC9zdmc+);background-image:-moz-linear-gradient(top,#fff 0,#eee 100%);background-image:-webkit-linear-gradient(top,#fff 0,#eee 100%);background-image:-o-linear-gradient(top,#fff 0,#eee 100%);background-image:linear-gradient(to bottom,#fff 0,#eee 100%)}.chat-page .sb-scrollbar-body,.widgetbar-widget .sb-scrollbar-body{border:0;background:#d8d8d8;width:6px}.gray .sb-scrollbar-body{background:#75757a;border-color:#75757a;border-radius:3px}.gray .sb-scrollbar-top,.gray .sb-scrollbar-bottom{display:none}.chat-page .sb-scrollbar-top,.chat-page .sb-scrollbar-bottom,.widgetbar-widget .sb-scrollbar-top,.widgetbar-widget .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;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}.tv-detail{height:100%;position:relative;overflow:hidden;-webkit-overflow-scrolling:touch}.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;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}.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;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;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}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:relative;padding-bottom:100px;margin-bottom:100px}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}body{min-width:600px}.load-chart .chart-search,.load-chart .chart-search input{width:100%}.save-load-buttons{margin-left:5px}.tv-button.getimage{padding:8px 7px 7px;margin-left:5px}</style></head><body class="chart-page on-widget"><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 Q82={};var __initialEnabledFeaturesets=["charting_library"];</script><script>var D76=function(){var a={};if("undefined"!=typeof D76)return D76;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:{},header_fullscreen_button:{},header_symbol_search:{},
|
|
header_resolutions:{},header_chart_type:{},header_settings:{},header_indicators:{},header_compare:{},header_undo_redo:{},header_screenshot:{},header_saveload:{},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_screenshot header_fullscreen_button".split(" ")},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:{},use_localstorage_for_settings:{subsets:["items_favoriting"]},plain_studymarket:{},trading_options:{},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:{},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 save_old_chart_before_save_as".split(" ")},
|
|
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 header_widget_dom_node header_symbol_search header_resolutions header_chart_type header_indicators header_compare".split(" ")},charting_library:{subsets:"daily_timeframe_suffix custom_items_in_context_menu pay_attention_to_ticker_not_symbol graying_disabled_tools_enabled update_study_formatter_on_symbol_resolve constraint_dialogs_movement header_widget left_toolbar control_bar widget_logo timeframes_toolbar context_menus edit_buttons_in_legend use_localstorage_for_settings plain_studymarket border_around_the_chart saveload_storage_customization volume_force_overlay header_fullscreen_button lean_chart_load stop_study_on_restart header_saveload create_volume_indicator_by_default adapt_onchart_logo_background update_timeframes_set_on_symbol_resolve refresh_saved_charts_list_on_dialog_show".split(" ")},
|
|
static_charts_service:{subsets:["charting_library","disable_resolution_rebuild","log_data_request_time","same_data_requery"]},charting_platform:{subsets:["charting_library","trading_options"]}},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(!1==k[a])return!1;
|
|
a=k[a];for(var c=0;c<b.length;++c)a|=D76.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=D76);(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=R[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(J,"-$1").toLowerCase(),d=a.getAttribute(d),"string"===typeof d){try{d="true"===d?!0:"false"===d?!1:"null"===d?null:r.isNumeric(d)?+d:L.test(d)?r.parseJSON(d):d}catch(e){}r.data(a,c,d)}else d=b;return d}function e(a){for(var b in a)if(("data"!==b||!r.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=r._data(a,d);!g||"queue"!==c&&r._data(a,e)||"mark"!==c&&r._data(a,f)||setTimeout(function(){r._data(a,e)||r._data(a,f)||(r.removeData(a,d,!0),g.fire())},0)}function g(){return!1}function h(){return!0}function k(a,b,c){b=b||0;if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)===c});if(b.nodeType)return r.grep(a,function(a,d){return a===b===c});if("string"===typeof b){var d=r.grep(a,function(a){return 1===a.nodeType});if(Xa.test(b))return r.filter(b,
|
|
d,!c);b=r.filter(b,d)}return r.grep(a,function(a,d){return 0<=r.inArray(a,b)===c})}function l(a){var b=ra.split("|");a=a.createDocumentFragment();if(a.createElement)for(;b.length;)a.createElement(b.pop());return a}function m(a,b){if(1===b.nodeType&&r.hasData(a)){var c,d,e;d=r._data(a);var f=r._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++)r.event.add(b,c,g[c][d]);f.data&&(f.data=r.extend({},f.data))}}function q(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(r.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}
|
|
function n(a){return"undefined"!==typeof a.getElementsByTagName?a.getElementsByTagName("*"):"undefined"!==typeof a.querySelectorAll?a.querySelectorAll("*"):[]}function t(a){if("checkbox"===a.type||"radio"===a.type)a.defaultChecked=a.checked}function u(a){var b=(a.nodeName||"").toLowerCase();"input"===b?t(a):"script"!==b&&"undefined"!==typeof a.getElementsByTagName&&r.grep(a.getElementsByTagName("input"),t)}function z(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(r.css(a,"padding"+ma[e]))||0),d="margin"===c?d+(parseFloat(r.css(a,c+ma[e]))||0):d-(parseFloat(r.css(a,"border"+ma[e]+"Width"))||0);return d+"px"}d=ia(a,b);if(0>d||null==d)d=a.style[b];if(xa.test(d))return d;d=parseFloat(d)||0;if(c)for(;4>e;e+=2)d+=parseFloat(r.css(a,"padding"+ma[e]))||0,"padding"!==c&&(d+=parseFloat(r.css(a,"border"+ma[e]+"Width"))||0),"margin"===c&&(d+=parseFloat(r.css(a,c+ma[e]))||0);return d+"px"}function s(a){return function(b,c){"string"!==
|
|
typeof b&&(c=b,b="*");if(r.isFunction(c))for(var d=b.toLowerCase().split(hb),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 A(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===Ya,n;h<k&&(l||!n);h++)n=f[h](c,d,e),"string"===typeof n&&(!l||g[n]?n=b:(c.dataTypes.unshift(n),n=A(a,c,d,e,n,g)));!l&&n||g["*"]||(n=A(a,c,d,e,"*",g));return n}function B(a,c){var d,e,f=r.ajaxSettings.flatOptions||
|
|
{};for(d in c)c[d]!==b&&((f[d]?a:e||(e={}))[d]=c[d]);e&&r.extend(!0,a,e)}function w(a,b,c,d){if(r.isArray(b))r.each(b,function(b,e){c||Ja.test(a)?d(a,e):w(a+"["+("object"===typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(var e in b)w(a+"["+e+"]",b[e],c,d)}function v(){try{return new a.XMLHttpRequest}catch(b){}}function C(){setTimeout(G,0);return Ka=r.now()}function G(){Ka=b}function I(a,b){var c={};r.each(La.concat.apply([],La.slice(0,b)),function(){c[this]=a});return c}
|
|
function E(a){if(!Za[a]){var b=D.body,c=r("<"+a+">").appendTo(b),d=c.css("display");c.remove();if("none"===d||""===d)ja||(ja=D.createElement("iframe"),ja.frameBorder=ja.width=ja.height=0),b.appendChild(ja),va&&ja.createElement||(va=(ja.contentWindow||ja.contentDocument).document,va.write((r.support.boxModel?"<!doctype html>":"")+"<html><body>"),va.close()),c=va.createElement(a),va.body.appendChild(c),d=r.css(c,"display"),b.removeChild(ja);Za[a]=d}return Za[a]}function K(a){return r.isWindow(a)?a:
|
|
9===a.nodeType?a.defaultView||a.parentWindow:!1}var D=a.document,F=a.navigator,P=a.location,r=function(){function c(){if(!d.isReady){try{D.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+/,n=/\s+$/,r=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,q=/^[\],:{}\s]*$/,m=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,t=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
|
s=/(?:^|:|,)(?:\s*\[)+/g,B=/(webkit)[ \/]([\w.]+)/,v=/(opera)(?:.*version)?[ \/]([\w.]+)/,w=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,z=/-([a-z]|[0-9])/ig,C=/^-ms-/,Q=function(a,b){return(b+"").toUpperCase()},G=F.userAgent,M,I,A=Object.prototype.toString,L=Object.prototype.hasOwnProperty,E=Array.prototype.push,J=Array.prototype.slice,da=String.prototype.trim,R=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&&D.body)return this.context=D,this[0]=D.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:D,(a=r.exec(a))?d.isPlainObject(c)?(a=[D.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=D.getElementById(f[2]))&&c.parentNode){if(c.id!==f[2])return e.find(a);this.length=1;this[0]=c}this.context=D;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 J.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)?E.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();M.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(J.apply(this,arguments),"slice",J.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:E,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,n=!1;"boolean"===typeof h&&(n=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&&(n&&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(n,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(!D.body)return setTimeout(d.ready,
|
|
1);d.isReady=!0;!0!==a&&0<--d.readyWait||(M.fireWith(D,[d]),d.fn.trigger&&d(D).trigger("ready").off("ready"))}},bindReady:function(){if(!M){M=d.Callbacks("once memory");if("complete"===D.readyState)return setTimeout(d.ready,1);if(D.addEventListener)D.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",d.ready,!1);else if(D.attachEvent){D.attachEvent("onreadystatechange",I);a.attachEvent("onload",d.ready);var b=!1;try{b=null==a.frameElement}catch(e){}D.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[A.call(a)]||"object"},isPlainObject:function(a){if(!a||"object"!==d.type(a)||a.nodeType||d.isWindow(a))return!1;try{if(a.constructor&&!L.call(a,"constructor")&&!L.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}for(var e in a);
|
|
return e===b||L.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(q.test(b.replace(m,"@").replace(t,"]").replace(s,"")))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(C,"ms-").replace(z,Q)},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:da?function(a){return null==a?"":da.call(a)}:function(a){return null==a?"":a.toString().replace(l,"").replace(n,"")},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)?E.call(c,a):d.merge(c,a)}return c},inArray:function(a,
|
|
b,c){var d;if(b){if(R)return R.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=J.call(arguments,2),e=function(){return a.apply(c,f.concat(J.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,n=null==e,r=0,q=a.length;if(e&&"object"===typeof e){for(r in e)d.access(a,
|
|
c,r,e[r],1,h,f);g=1}else if(f!==b){l=k===b&&d.isFunction(f);n&&(l?(l=c,c=function(a,b,c){return l.call(d(a),c)}):(c.call(a,f),c=null));if(c)for(;r<q;r++)c(a[r],e,l?f.call(a[r],r,c(a[r],e)):f,k);g=1}return g?a:n?c.call(a):q?c(a[0],e):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();a=B.exec(a)||v.exec(a)||w.exec(a)||0>a.indexOf("compatible")&&u.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(D);return a},browser:{}});d.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){K["[object "+b+"]"]=b.toLowerCase()});G=d.uaMatch(G);G.browser&&(d.browser[G.browser]=!0,d.browser.version=G.version);d.browser.webkit&&(d.browser.safari=!0);k.test("\u00a0")&&
|
|
(l=/^[\s\xA0]+/,n=/[\s\xA0]+$/);g=d(D);D.addEventListener?I=function(){D.removeEventListener("DOMContentLoaded",I,!1);d.ready()}:D.attachEvent&&(I=function(){"complete"===D.readyState&&(D.detachEvent("onreadystatechange",I),d.ready())});return d}(),R={};r.Callbacks=function(a){a=a?R[a]||c(a):{};var d=[],e=[],f,g,h,k,l,n,q=function(b){var c,e,f,g;c=0;for(e=b.length;c<e;c++)f=b[c],g=r.type(f),"array"===g?q(f):"function"===g&&(a.unique&&t.has(f)||d.push(f))},m=function(b,c){c=c||[];f=!a.memory||[b,c];
|
|
h=g=!0;n=k||0;k=0;for(l=d.length;d&&n<l;n++)if(!1===d[n].apply(b,c)&&a.stopOnFalse){f=!0;break}h=!1;d&&(a.once?!0===f?t.disable():d=[]:e&&e.length&&(f=e.shift(),t.fireWith(f[0],f[1])))},t={add:function(){if(d){var a=d.length;q(arguments);h?l=d.length:f&&!0!==f&&(k=a,m(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<=n&&n--),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||t.disable();return this},locked:function(){return!e},fireWith:function(b,c){e&&(h?a.once||e.push([b,c]):a.once&&f||m(b,c));return this},fire:function(){t.fireWith(this,arguments);return this},fired:function(){return!!g}};return t};var M=[].slice;r.extend({Deferred:function(a){var b=r.Callbacks("once memory"),c=r.Callbacks("once memory"),
|
|
d=r.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 r.Deferred(function(d){r.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],f;if(r.isFunction(c))h[a](function(){if((f=
|
|
c.apply(this,arguments))&&r.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?
|
|
M.call(arguments,0):b;--h||k.resolveWith(k,d)}}function c(a){return function(b){g[a]=1<arguments.length?M.call(arguments,0):b;k.notifyWith(l,g)}}var d=M.call(arguments,0),e=0,f=d.length,g=Array(f),h=f,k=1>=f&&a&&r.isFunction(a.promise)?a:r.Deferred(),l=k.promise();if(1<f){for(;e<f;e++)d[e]&&d[e].promise&&r.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}});r.support=function(){var b,c,d,e,f,g,h,k,l=D.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=D.createElement("select");f=e.appendChild(D.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:!!D.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==D.createElement("nav").cloneNode(!0).outerHTML,submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,
|
|
pixelMargin:!0};r.boxModel=b.boxModel="CSS1Compat"===D.compatMode;c.checked=!0;b.noCloneChecked=c.cloneNode(!0).checked;e.disabled=!0;b.optDisabled=!f.disabled;try{delete l.test}catch(n){b.deleteExpando=!1}!l.addEventListener&&l.attachEvent&&l.fireEvent&&(l.attachEvent("onclick",function(){b.noCloneEvent=!1}),l.cloneNode(!0).fireEvent("onclick"));c=D.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=D.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;r(function(){var c,d,e,f,h=D.getElementsByTagName("body")[0];h&&(c=D.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=D.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=D.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,r.extend(b,
|
|
f))});return b}();var L=/^(?:\{.*\}|\[.*\])$/,J=/([A-Z])/g;r.extend({cache:{},uuid:0,expando:"jQuery"+(r.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?r.cache[a[r.expando]]:a[r.expando];return!!a&&!e(a)},data:function(a,c,d,e){if(r.acceptData(a)){var f;f=r.expando;var g="string"===typeof c,h=a.nodeType,k=h?r.cache:a,l=h?a[f]:a[f]&&f,n="events"===c;if(l&&k[l]&&(n||e||k[l].data)||!g||d!==b){l||
|
|
(h?a[f]=l=++r.uuid:l=f);k[l]||(k[l]={},h||(k[l].toJSON=r.noop));if("object"===typeof c||"function"===typeof c)e?k[l]=r.extend(k[l],c):k[l].data=r.extend(k[l].data,c);f=a=k[l];e||(a.data||(a.data={}),a=a.data);d!==b&&(a[r.camelCase(c)]=d);if(n&&!a[c])return f.events;g?(d=a[c],null==d&&(d=a[r.camelCase(c)])):d=a;return d}}},removeData:function(a,b,c){if(r.acceptData(a)){var d,f,g,h=r.expando,k=a.nodeType,l=k?r.cache:a,n=k?a[h]:h;if(l[n]){if(b&&(d=c?l[n]:l[n].data)){r.isArray(b)||(b in d?b=[b]:(b=r.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:r.isEmptyObject)(d))return}if(!c&&(delete l[n].data,!e(l[n])))return;r.support.deleteExpando||!l.setInterval?delete l[n]:l[n]=null;k&&(r.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}}},_data:function(a,b,c){return r.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=r.noData[a.nodeName.toLowerCase()];if(b)return!(!0===b||a.getAttribute("classid")!==b)}return!0}});r.fn.extend({data:function(a,
|
|
c){var e,f,g,h,k,l=this[0],n=0,q=null;if(a===b){if(this.length&&(q=r.data(l),1===l.nodeType&&!r._data(l,"parsedAttrs"))){g=l.attributes;for(k=g.length;n<k;n++)h=g[n].name,0===h.indexOf("data-")&&(h=r.camelCase(h.substring(5)),d(l,h,q[h]));r._data(l,"parsedAttrs",!0)}return q}if("object"===typeof a)return this.each(function(){r.data(this,a)});e=a.split(".",2);e[1]=e[1]?"."+e[1]:"";f=e[1]+"!";return r.access(this,function(c){if(c===b)return q=this.triggerHandler("getData"+f,[e[0]]),q===b&&l&&(q=r.data(l,
|
|
a),q=d(l,a,q)),q===b&&e[1]?this.data(e[0]):q;e[1]=c;this.each(function(){var b=r(this);b.triggerHandler("setData"+f,e);r.data(this,a,c);b.triggerHandler("changeData"+f,e)})},null,c,1<arguments.length,null,!1)},removeData:function(a){return this.each(function(){r.removeData(this,a)})}});r.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",r._data(a,b,(r._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:(r._data(b,d)||1)-1)?r._data(b,d,a):(r.removeData(b,
|
|
d,!0),f(b,c,"mark"))}},queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=r._data(a,b),c&&(!d||r.isArray(c)?d=r._data(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.shift(),e={};"inprogress"===d&&(d=c.shift());d&&("fx"===b&&c.unshift("inprogress"),r._data(a,b+".run",e),d.call(a,function(){r.dequeue(a,b)},e));c.length||(r.removeData(a,b+"queue "+b+".run",!0),f(a,b,"queue"))}});r.fn.extend({queue:function(a,c){var d=2;"string"!==typeof a&&(c=
|
|
a,a="fx",d--);return arguments.length<d?r.queue(this[0],a):c===b?this:this.each(function(){var b=r.queue(this,a,c);"fx"===a&&"inprogress"!==b[0]&&r.dequeue(this,a)})},dequeue:function(a){return this.each(function(){r.dequeue(this,a)})},delay:function(a,b){a=r.fx?r.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=r.Deferred(),f=this,g=f.length,h=1,k=a+"defer",l=a+"queue",n=a+"mark",q;g--;)if(q=r.data(f[g],k,b,!0)||(r.data(f[g],l,b,!0)||r.data(f[g],n,b,!0))&&r.data(f[g],k,r.Callbacks("once memory"),!0))h++,q.add(d);d();return e.promise(c)}});var N=/[\n\t\r]/g,T=/\s+/,O=/\r/g,W=/^(?:button|input)$/i,Z=/^(?:button|input|object|select|textarea)$/i,X=/^a(?:rea)?$/i,aa=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
|
|
U=r.support.getSetAttribute,Y,H,S;r.fn.extend({attr:function(a,b){return r.access(this,r.attr,a,b,1<arguments.length)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})},prop:function(a,b){return r.access(this,r.prop,a,b,1<arguments.length)},removeProp:function(a){a=r.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(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,this.className))});
|
|
if(a&&"string"===typeof a)for(b=a.split(T),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=r.trim(f)}else e.className=a;return this},removeClass:function(a){var c,d,e,f,g,h,k;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,this.className))});if(a&&"string"===typeof a||a===b)for(c=(a||"").split(T),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=r.trim(g)}else f.className="";return this},toggleClass:function(a,b){var c=typeof a,d="boolean"===typeof b;return r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if("string"===c)for(var e,f=0,g=r(this),h=b,k=a.split(T);e=k[f++];)h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e);else if("undefined"===
|
|
c||"boolean"===c)this.className&&r._data(this,"__className__",this.className),this.className=this.className||!1===a?"":r._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=r.isFunction(a),this.each(function(d){var f=r(this);1===this.nodeType&&(d=e?a.call(this,d,f.val()):a,null==d?d="":
|
|
"number"===typeof d?d+="":r.isArray(d)&&(d=r.map(d,function(a){return null==a?"":a+""})),c=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],c&&"set"in c&&c.set(this,d,"value")!==b||(this.value=d))});if(f){if((c=r.valHooks[f.type]||r.valHooks[f.nodeName.toLowerCase()])&&"get"in c&&(d=c.get(f,"value"))!==b)return d;d=f.value;return"string"===typeof d?d.replace(O,""):null==d?"":d}}});r.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&&!((r.support.optDisabled?b.disabled:null!==b.getAttribute("disabled"))||b.parentNode.disabled&&r.nodeName(b.parentNode,"optgroup"))){b=r(b).val();if(g)return b;e.push(b)}return g&&!e.length&&f.length?r(f[d]).val():e},set:function(a,b){var c=r.makeArray(b);r(a).find("option").each(function(){this.selected=0<=r.inArray(r(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 r.attrFn)return r(a)[c](d);if("undefined"===typeof a.getAttribute)return r.prop(a,c,d);if(e=1!==h||!r.isXMLDoc(a))c=c.toLowerCase(),g=r.attrHooks[c]||(aa.test(c)?H:Y);if(d!==b)if(null===d)r.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(T),f=d.length;h<f;h++)if(e=d[h])c=r.propFix[e]||e,(g=aa.test(e))||r.attr(a,e,""),a.removeAttribute(U?e:c),g&&c in a&&(a[c]=!1)},attrHooks:{type:{set:function(a,b){if(W.test(a.nodeName)&&a.parentNode)r.error("type property can't be changed");else if(!r.support.radioValue&&"radio"===b&&r.nodeName(a,"input")){var c=a.value;
|
|
a.setAttribute("type",b);c&&(a.value=c);return b}}},value:{get:function(a,b){return Y&&r.nodeName(a,"button")?Y.get(a,b):b in a?a.value:null},set:function(a,b,c){if(Y&&r.nodeName(a,"button"))return Y.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||!r.isXMLDoc(a))c=r.propFix[c]||c,f=r.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):Z.test(a.nodeName)||X.test(a.nodeName)&&a.href?0:b}}}});r.attrHooks.tabindex=r.propHooks.tabIndex;H={get:function(a,c){var d,e=r.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?r.removeAttr(a,c):(b=r.propFix[c]||c,b in a&&(a[b]=!0),a.setAttribute(c,c.toLowerCase()));return c}};U||(S={name:!0,id:!0,coords:!0},Y=r.valHooks.button={get:function(a,c){var d;return(d=a.getAttributeNode(c))&&(S[c]?""!==d.nodeValue:d.specified)?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);d||(d=D.createAttribute(c),a.setAttributeNode(d));return d.nodeValue=b+""}},r.attrHooks.tabindex.set=
|
|
Y.set,r.each(["width","height"],function(a,b){r.attrHooks[b]=r.extend(r.attrHooks[b],{set:function(a,c){if(""===c)return a.setAttribute(b,"auto"),c}})}),r.attrHooks.contenteditable={get:Y.get,set:function(a,b,c){""===b&&(b="false");Y.set(a,b,c)}});r.support.hrefNormalized||r.each(["href","src","width","height"],function(a,c){r.attrHooks[c]=r.extend(r.attrHooks[c],{get:function(a){a=a.getAttribute(c,2);return null===a?b:a}})});r.support.style||(r.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||
|
|
b},set:function(a,b){return a.style.cssText=""+b}});r.support.optSelected||(r.propHooks.selected=r.extend(r.propHooks.selected,{get:function(a){if(a=a.parentNode)a.selectedIndex,a.parentNode&&a.parentNode.selectedIndex;return null}}));r.support.enctype||(r.propFix.enctype="encoding");r.support.checkOn||r.each(["radio","checkbox"],function(){r.valHooks[this]={get:function(a){return null===a.getAttribute("value")?"on":a.value}}});r.each(["radio","checkbox"],function(){r.valHooks[this]=r.extend(r.valHooks[this],
|
|
{set:function(a,b){if(r.isArray(b))return a.checked=0<=r.inArray(r(a).val(),b)}})});var V=/^(?:textarea|input|select)$/i,ea=/^([^\.]*)?(?:\.(.+))?$/,fa=/(?:^|\s)hover(\.\S+)?\b/,ka=/^key/,ga=/^(?:mouse|contextmenu)|click/,ba=/^(?:focusinfocus|focusoutblur)$/,na=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,sa=function(a){if(a=na.exec(a))a[1]=(a[1]||"").toLowerCase(),a[3]=a[3]&&RegExp("(?:^|\\s)"+a[3]+"(?:\\s|$)");return a},qa=function(a){return r.event.special.hover?a:a.replace(fa,"mouseenter$1 mouseleave$1")};
|
|
r.event={add:function(a,c,d,e,f){var g,h,k,l,n,q,m,t,s;if(3!==a.nodeType&&8!==a.nodeType&&c&&d&&(g=r._data(a))){d.handler&&(m=d,d=m.handler,f=m.selector);d.guid||(d.guid=r.guid++);k=g.events;k||(g.events=k={});h=g.handle;h||(g.handle=h=function(a){return"undefined"===typeof r||a&&r.event.triggered===a.type?b:r.event.dispatch.apply(h.elem,arguments)},h.elem=a);c=r.trim(qa(c)).split(" ");for(g=0;g<c.length;g++)l=ea.exec(c[g])||[],n=l[1],q=(l[2]||"").split(".").sort(),s=r.event.special[n]||{},n=(f?s.delegateType:
|
|
s.bindType)||n,s=r.event.special[n]||{},l=r.extend({type:n,origType:l[1],data:e,handler:d,guid:d.guid,selector:f,quick:f&&sa(f),namespace:q.join(".")},m),t=k[n],t||(t=k[n]=[],t.delegateCount=0,s.setup&&!1!==s.setup.call(a,e,q,h)||(a.addEventListener?a.addEventListener(n,h,!1):a.attachEvent&&a.attachEvent("on"+n,h))),s.add&&(s.add.call(a,l),l.handler.guid||(l.handler.guid=d.guid)),f?t.splice(t.delegateCount++,0,l):t.push(l),r.event.global[n]=!0;a=null}},global:{},remove:function(a,b,c,d,e){var f=r.hasData(a)&&
|
|
r._data(a),g,h,k,l,n,q,m,t,s,B;if(f&&(m=f.events)){b=r.trim(qa(b||"")).split(" ");for(g=0;g<b.length;g++)if(h=ea.exec(b[g])||[],k=l=h[1],h=h[2],k){t=r.event.special[k]||{};k=(d?t.delegateType:t.bindType)||k;s=m[k]||[];n=s.length;h=h?RegExp("(^|\\.)"+h.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(q=0;q<s.length;q++)B=s[q],!e&&l!==B.origType||c&&c.guid!==B.guid||h&&!h.test(B.namespace)||d&&!(d===B.selector||"**"===d&&B.selector)||(s.splice(q--,1),B.selector&&s.delegateCount--,t.remove&&
|
|
t.remove.call(a,B));0===s.length&&n!==s.length&&(t.teardown&&!1!==t.teardown.call(a,h)||r.removeEvent(a,k,f.handle),delete m[k])}else for(k in m)r.event.remove(a,k+b[g],c,d,!0);if(r.isEmptyObject(m)){if(b=f.handle)b.elem=null;r.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,n,q,m;if(!ba.test(g+r.event.triggered)&&(0<=g.indexOf("!")&&(g=g.slice(0,-1),k=!0),0<=g.indexOf(".")&&
|
|
(h=g.split("."),g=h.shift(),h.sort()),e&&!r.event.customEvent[g]||r.event.global[g]))if(c="object"===typeof c?c[r.expando]?c:new r.Event(g,c):new r.Event(g),c.type=g,c.isTrigger=!0,c.exclusive=k,c.namespace=h.join("."),c.namespace_re=c.namespace?RegExp("(^|\\.)"+h.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,k=0>g.indexOf(":")?"on"+g:"",e){if(c.result=b,c.target||(c.target=e),d=null!=d?r.makeArray(d):[],d.unshift(c),n=r.event.special[g]||{},!n.trigger||!1!==n.trigger.apply(e,d)){m=[[e,n.bindType||g]];if(!f&&
|
|
!n.noBubble&&!r.isWindow(e)){q=n.delegateType||g;h=ba.test(q+g)?e:e.parentNode;for(l=null;h;h=h.parentNode)m.push([h,q]),l=h;l&&l===e.ownerDocument&&m.push([l.defaultView||l.parentWindow||a,q])}for(l=0;l<m.length&&!c.isPropagationStopped();l++)h=m[l][0],c.type=m[l][1],(q=(r._data(h,"events")||{})[c.type]&&r._data(h,"handle"))&&q.apply(h,d),(q=k&&h[k])&&r.acceptData(h)&&!1===q.apply(h,d)&&c.preventDefault();c.type=g;f||c.isDefaultPrevented()||n._default&&!1!==n._default.apply(e.ownerDocument,d)||"click"===
|
|
g&&r.nodeName(e,"a")||!r.acceptData(e)||!k||!e[g]||("focus"===g||"blur"===g)&&0===c.target.offsetWidth||r.isWindow(e)||((l=e[k])&&(e[k]=null),r.event.triggered=g,e[g](),r.event.triggered=b,l&&(e[k]=l));return c.result}}else for(l in e=r.cache,e)e[l].events&&e[l].events[g]&&r.event.trigger(c,d,e[l].handle.elem,!0)}},dispatch:function(c){c=r.event.fix(c||a.event);var d=(r._data(this,"events")||{})[c.type]||[],e=d.delegateCount,f=[].slice.call(arguments,0),g=!c.exclusive&&!c.namespace,h=r.event.special[c.type]||
|
|
{},k=[],l,n,q,m,t,s,B;f[0]=c;c.delegateTarget=this;if(!h.preDispatch||!1!==h.preDispatch.call(this,c)){if(e&&(!c.button||"click"!==c.type))for(q=r(this),q.context=this.ownerDocument||this,n=c.target;n!=this;n=n.parentNode||this)if(!0!==n.disabled){t={};s=[];q[0]=n;for(l=0;l<e;l++){m=d[l];B=m.selector;if(t[B]===b){var v=t,w=B,u;if(m.quick){u=m.quick;var z=n.attributes||{};u=(!u[1]||n.nodeName.toLowerCase()===u[1])&&(!u[2]||(z.id||{}).value===u[2])&&(!u[3]||u[3].test((z["class"]||{}).value))}else u=
|
|
q.is(B);v[w]=u}t[B]&&s.push(m)}s.length&&k.push({elem:n,matches:s})}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(m=e.matches[d],g||!c.namespace&&!m.namespace||c.namespace_re&&c.namespace_re.test(m.namespace))c.data=m.data,c.handleObj=m,m=((r.event.special[m.origType]||{}).handle||m.handler).apply(e.elem,f),m!==b&&(c.result=m,!1===m&&(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||D,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[r.expando])return a;var c,
|
|
d,e=a,f=r.event.fixHooks[a.type]||{},g=f.props?this.props.concat(f.props):this.props;a=r.Event(e);for(c=g.length;c;)d=g[--c],a[d]=e[d];a.target||(a.target=e.srcElement||D);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:r.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){r.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,
|
|
b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){a=r.extend(new r.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?r.event.trigger(a,null,b):r.event.dispatch.call(b,a);a.isDefaultPrevented()&&c.preventDefault()}};r.event.handle=r.event.dispatch;r.removeEvent=D.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)};r.Event=function(a,b){if(!(this instanceof r.Event))return new r.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&&r.extend(this,b);this.timeStamp=a&&a.timeStamp||r.now();this[r.expando]=!0};r.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};r.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){r.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=a.relatedTarget,d=a.handleObj,e;if(!c||c!==this&&!r.contains(this,c))a.type=d.origType,e=d.handler.apply(this,arguments),a.type=b;return e}}});r.support.submitBubbles||
|
|
(r.event.special.submit={setup:function(){if(r.nodeName(this,"form"))return!1;r.event.add(this,"click._submit keypress._submit",function(a){a=a.target;(a=r.nodeName(a,"input")||r.nodeName(a,"button")?a.form:b)&&!a._submit_attached&&(r.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&&r.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(r.nodeName(this,
|
|
"form"))return!1;r.event.remove(this,"._submit")}});r.support.changeBubbles||(r.event.special.change={setup:function(){if(V.test(this.nodeName)){if("checkbox"===this.type||"radio"===this.type)r.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),r.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,r.event.simulate("change",this,a,!0))});return!1}r.event.add(this,"beforeactivate._change",
|
|
function(a){a=a.target;V.test(a.nodeName)&&!a._change_attached&&(r.event.add(a,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||r.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(){r.event.remove(this,"._change");return V.test(this.nodeName)}});r.support.focusinBubbles||
|
|
r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=0,d=function(a){r.event.simulate(b,a.target,r.event.fix(a),!0)};r.event.special[b]={setup:function(){0===c++&&D.addEventListener(a,d,!0)},teardown:function(){0===--c&&D.removeEventListener(a,d,!0)}}});r.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){r().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=r.guid++));return this.each(function(){r.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;r(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(){r.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){r(this.context).on(a,this.selector,b,c);return this},die:function(a,b){r(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(){r.event.trigger(a,
|
|
b,this)})},triggerHandler:function(a,b){if(this[0])return r.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||r.guid++,d=0,e=function(c){var e=(r._data(this,"lastToggle"+a.guid)||0)%d;r._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)}});r.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){r.fn[b]=function(a,c){null==c&&(c=a,a=null);return 0<arguments.length?this.on(b,null,a,c):this.trigger(b)};r.attrFn&&(r.attrFn[b]=!0);ka.test(b)&&(r.event.fixHooks[b]=r.event.keyHooks);ga.test(b)&&(r.event.fixHooks[b]=r.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 n=!1,l=l[b];l;){if(l[e]===d){n=f[l.sizset];break}1!==l.nodeType||h||(l[e]=d,l.sizset=g);if(l.nodeName.toLowerCase()===c){n=l;break}l=l[b]}f[g]=n}}}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 n=!1,l=l[a];l;){if(l[e]===d){n=f[l.sizset];break}if(1===l.nodeType)if(h||(l[e]=d,l.sizset=g),"string"!==typeof b){if(l===b){n=!0;break}}else if(0<m.filter(b,[l]).length){n=l;break}l=l[a]}f[g]=n}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e="sizcache"+(Math.random()+"").replace(".",""),f=0,g=Object.prototype.toString,h=!1,k=!0,l=/\\/g,
|
|
n=/\r\n/g,q=/\W/;[0,0].sort(function(){k=!1;return 0});var m=function(a,b,c,e){c=c||[];var f=b=b||D;if(1!==b.nodeType&&9!==b.nodeType)return[];if(!a||"string"!==typeof a)return c;var h,k,l,n,r,q=!0,t=m.isXML(b),w=[],v=a;do if(d.exec(""),h=d.exec(v))if(v=h[3],w.push(h[1]),h[2]){n=h[3];break}while(h);if(1<w.length&&B.exec(a))if(2===w.length&&s.relative[w[0]])k=G(w[0]+w[1],b,e);else for(k=s.relative[w[0]]?[b]:m(w.shift(),b);w.length;)a=w.shift(),s.relative[a]&&(a+=w.shift()),k=G(a,k,e);else if(!e&&1<
|
|
w.length&&9===b.nodeType&&!t&&s.match.ID.test(w[0])&&!s.match.ID.test(w[w.length-1])&&(h=m.find(w.shift(),b,t),b=h.expr?m.filter(h.expr,h.set)[0]:h.set[0]),b)for(h=e?{expr:w.pop(),set:u(e)}:m.find(w.pop(),1!==w.length||"~"!==w[0]&&"+"!==w[0]||!b.parentNode?b:b.parentNode,t),k=h.expr?m.filter(h.expr,h.set):h.set,0<w.length?l=u(k):q=!1;w.length;)h=r=w.pop(),s.relative[r]?h=w.pop():r="",null==h&&(h=b),s.relative[r](l,h,t);else l=[];l||(l=k);l||m.error(r||a);if("[object Array]"===g.call(l))if(q)if(b&&
|
|
1===b.nodeType)for(a=0;null!=l[a];a++)l[a]&&(!0===l[a]||1===l[a].nodeType&&m.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 u(l,c);n&&(m(n,f,c,e),m.uniqueSort(c));return c};m.uniqueSort=function(a){if(C&&(h=k,a.sort(C),h))for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1);return a};m.matches=function(a,b){return m(a,null,null,b)};m.matchesSelector=function(a,b){return 0<m(b,null,null,[a]).length};m.find=function(a,
|
|
b,c){var d,e,f,g,h,k;if(!a)return[];e=0;for(f=s.order.length;e<f;e++)if(h=s.order[e],g=s.leftMatch[h].exec(a))if(k=g[1],g.splice(1,1),"\\"!==k.substr(k.length-1)&&(g[1]=(g[1]||"").replace(l,""),d=s.find[h](g,b,c),null!=d)){a=a.replace(s.match[h],"");break}d||(d="undefined"!==typeof b.getElementsByTagName?b.getElementsByTagName("*"):[]);return{set:d,expr:a}};m.filter=function(a,c,d,e){for(var f,g,h,k,l,n,r,q,t=a,w=[],B=c,v=c&&c[0]&&m.isXML(c[0]);a&&c.length;){for(h in s.filter)if(null!=(f=s.leftMatch[h].exec(a))&&
|
|
f[2]&&(n=s.filter[h],l=f[1],g=!1,f.splice(1,1),"\\"!==l.substr(l.length-1))){B===w&&(w=[]);if(s.preFilter[h])if(f=s.preFilter[h](f,B,d,w,e,v),!f)g=k=!0;else if(!0===f)continue;if(f)for(r=0;null!=(l=B[r]);r++)l&&(k=n(l,f,r,B),q=e^k,d&&null!=k?q?g=!0:B[r]=!1:q&&(w.push(l),g=!0));if(k!==b){d||(B=w);a=a.replace(s.match[h],"");if(!g)return[];break}}if(a===t)if(null==g)m.error(a);else break;t=a}return B};m.error=function(a){throw Error("Syntax error, unrecognized expression: "+a);};var t=m.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(n,"");for(a=a.firstChild;a;a=a.nextSibling)d+=t(a)}else{if(3===b||4===b)return a.nodeValue}else for(b=0;c=a[b];b++)8!==c.nodeType&&(d+=t(c));return d},s=m.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&&!q.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&&m.filter(b,a,!0)},">":function(a,b){var c,d="string"===typeof b,e=0,f=a.length;if(d&&!q.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&&m.filter(b,a,!0)}},"":function(b,d,e){var g,h=f++,k=c;"string"!==typeof d||q.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||q.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]||m.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]&&m.error(a[0]);a[0]=f++;return a},ATTR:function(a,b,c,d,e,f){b=a[1]=a[1].replace(l,"");!f&&s.attrMap[b]&&(a[1]=s.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]=m(a[3],null,null,b);else return a=m.filter(a[3],b,c,1^f),c||e.push.apply(e,a),!1;else if(s.match.POS.test(a[0])||s.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!!m(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=s.filters[e];if(f)return f(a,c,b,d);if("contains"===e)return 0<=(a.textContent||a.innerText||t([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}m.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=m.attr?m.attr(a,c):s.attrHandle[c]?
|
|
s.attrHandle[c](a):null!=a[c]?a[c]:a.getAttribute(c),d=c+"",e=b[2],f=b[4];return null==c?"!="===e:!e&&m.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=s.setFilters[b[2]];if(e)return e(a,c,b,d)}}},B=s.match.POS,v=function(a,b){return"\\"+(b-0+1)},w;for(w in s.match)s.match[w]=RegExp(s.match[w].source+
|
|
/(?![^\[]*\])(?![^\(]*\))/.source),s.leftMatch[w]=RegExp(/(^(?:.|\r|\n)*?)/.source+s.match[w].source.replace(/\\(\d+)/g,v));s.match.globalPOS=B;var u=function(a,b){a=Array.prototype.slice.call(a,0);return b?(b.push.apply(b,a),b):a};try{Array.prototype.slice.call(D.documentElement.childNodes,0)[0].nodeType}catch(z){u=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 C,Q;D.documentElement.compareDocumentPosition?C=function(a,b){return a===b?(h=!0,0):a.compareDocumentPosition&&b.compareDocumentPosition?a.compareDocumentPosition(b)&4?-1:1:a.compareDocumentPosition?-1:1}:(C=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 Q(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 Q(e[g],f[g]);return g===c?Q(a,f[g],-1):Q(e[g],b,1)},Q=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=D.createElement("div"),c="script"+(new Date).getTime(),d=D.documentElement;a.innerHTML="<a name='"+c+"'/>";d.insertBefore(a,d.firstChild);D.getElementById(c)&&(s.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:[]},s.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=D.createElement("div");a.appendChild(D.createComment(""));0<a.getElementsByTagName("*").length&&(s.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")&&(s.attrHandle.href=function(a){return a.getAttribute("href",2)});a=null})();D.querySelectorAll&&function(){var a=m,b=D.createElement("div");b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||0!==b.querySelectorAll(".TEST").length){m=function(b,c,d,e){c=c||D;if(!e&&!m.isXML(c)){var f=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(f&&
|
|
(1===c.nodeType||9===c.nodeType)){if(f[1])return u(c.getElementsByTagName(b),d);if(f[2]&&s.find.CLASS&&c.getElementsByClassName)return u(c.getElementsByClassName(f[2]),d)}if(9===c.nodeType){if("body"===b&&c.body)return u([c.body],d);if(f&&f[3]){var g=c.getElementById(f[3]);if(g&&g.parentNode){if(g.id===f[3])return u([g],d)}else return u([],d)}try{return u(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,n=/^\s*[+~]/.test(b);g?k=k.replace(/'/g,"\\$&"):c.setAttribute("id",k);n&&l&&(c=c.parentNode);try{if(!n||l)return u(c.querySelectorAll("[id='"+k+"'] "+b),d)}catch(r){}finally{g||f.removeAttribute("id")}}}return a(b,c,d,e)};for(var c in a)m[c]=a[c];b=null}}();(function(){var a=D.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var c=!b.call(D.createElement("div"),"div"),d=!1;try{b.call(D.documentElement,"[test!='']:sizzle")}catch(e){d=
|
|
!0}m.matchesSelector=function(a,e){e=e.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(d||!s.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<m(e,null,null,[a]).length}}})();(function(){var a=D.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&&
|
|
(s.order.splice(1,0,"CLASS"),s.find.CLASS=function(a,b,c){if("undefined"!==typeof b.getElementsByClassName&&!c)return b.getElementsByClassName(a[1])},a=null))})();m.contains=D.documentElement.contains?function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:D.documentElement.compareDocumentPosition?function(a,b){return!!(a.compareDocumentPosition(b)&16)}:function(){return!1};m.isXML=function(a){return(a=(a?a.ownerDocument||a:0).documentElement)?"HTML"!==a.nodeName:!1};var G=function(a,b,c){var d,
|
|
e=[],f="";for(b=b.nodeType?[b]:b;d=s.match.PSEUDO.exec(a);)f+=d[0],a=a.replace(s.match.PSEUDO,"");a=s.relative[a]?a+"*":a;d=0;for(var g=b.length;d<g;d++)m(a,b[d],e,c);return m.filter(f,e)};m.attr=r.attr;m.selectors.attrMap={};r.find=m;r.expr=m.selectors;r.expr[":"]=r.expr.filters;r.unique=m.uniqueSort;r.text=m.getText;r.isXMLDoc=m.isXML;r.contains=m.contains})();var oa=/Until$/,$a=/^(?:parents|prevUntil|prevAll)/,Ma=/,/,Xa=/^.[^:#\[\.,]*$/,ab=Array.prototype.slice,Na=r.expr.match.globalPOS,Oa={children:!0,
|
|
contents:!0,next:!0,prev:!0};r.fn.extend({find:function(a){var b=this,c,d;if("string"!==typeof a)return r(a).filter(function(){c=0;for(d=b.length;c<d;c++)if(r.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,r.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=r(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(r.contains(this,b[a]))return!0})},
|
|
not:function(a){return this.pushStack(k(this,a,!1),"not",a)},filter:function(a){return this.pushStack(k(this,a,!0),"filter",a)},is:function(a){return!!a&&("string"===typeof a?Na.test(a)?0<=r(a,this.context).index(this[0]):0<r.filter(a,this).length:0<this.filter(a).length)},closest:function(a,b){var c=[],d,e,f=this[0];if(r.isArray(a)){for(e=1;f&&f.ownerDocument&&f!==b;){for(d=0;d<a.length;d++)r(f).is(a[d])&&c.push({selector:a[d],elem:f,level:e});f=f.parentNode;e++}return c}var g=Na.test(a)||"string"!==
|
|
typeof a?r(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):r.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?r.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){return a?"string"===typeof a?r.inArray(this[0],r(a)):r.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?r(a,b):r.makeArray(a&&
|
|
a.nodeType?[a]:a),d=r.merge(this.get(),c);return this.pushStack(c[0]&&c[0].parentNode&&11!==c[0].parentNode.nodeType&&d[0]&&d[0].parentNode&&11!==d[0].parentNode.nodeType?r.unique(d):d)},andSelf:function(){return this.add(this.prevObject)}});r.each({parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},parents:function(a){return r.dir(a,"parentNode")},parentsUntil:function(a,b,c){return r.dir(a,"parentNode",c)},next:function(a){return r.nth(a,2,"nextSibling")},prev:function(a){return r.nth(a,
|
|
2,"previousSibling")},nextAll:function(a){return r.dir(a,"nextSibling")},prevAll:function(a){return r.dir(a,"previousSibling")},nextUntil:function(a,b,c){return r.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return r.dir(a,"previousSibling",c)},siblings:function(a){return r.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return r.sibling(a.firstChild)},contents:function(a){return r.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:r.makeArray(a.childNodes)}},function(a,
|
|
b){r.fn[a]=function(c,d){var e=r.map(this,b,c);oa.test(a)||(d=c);d&&"string"===typeof d&&(e=r.filter(d,e));e=1<this.length&&!Oa[a]?r.unique(e):e;(1<this.length||Ma.test(d))&&$a.test(a)&&(e=e.reverse());return this.pushStack(e,a,ab.call(arguments).join(","))}});r.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return 1===b.length?r.find.matchesSelector(b[0],a)?[b[0]]:[]:r.find.matches(a,b)},dir:function(a,c,d){var e=[];for(a=a[c];a&&9!==a.nodeType&&(d===b||1!==a.nodeType||!r(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 ra="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",Pa=/ jQuery\d+="(?:\d+|null)"/g,ya=/^\s+/,Qa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ra=/<([\w:]+)/,
|
|
bb=/<tbody/i,cb=/<|&#?\w+;/,za=/<(?:script|style)/i,db=/<(?:script|object|embed|option|style)/i,Sa=RegExp("<(?:"+ra+")[\\s/>]","i"),Ta=/checked\s*(?:[^=]|=\s*.checked.)/i,Aa=/\/(java|ecma)script/i,Ua=/^\s*<!(?:\[CDATA\[|\-\-)/,ca={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,"",""]},Ba=l(D);ca.optgroup=ca.option;ca.tbody=ca.tfoot=ca.colgroup=ca.caption=ca.thead;ca.th=ca.td;r.support.htmlSerialize||(ca._default=[1,"div<div>","</div>"]);r.fn.extend({text:function(a){return r.access(this,function(a){return a===b?r.text(this):this.empty().append((this[0]&&this[0].ownerDocument||D).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(r.isFunction(a))return this.each(function(b){r(this).wrapAll(a.call(this,b))});if(this[0]){var b=
|
|
r(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 r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):
|
|
a)})},unwrap:function(){return this.parent().each(function(){r.nodeName(this,"body")||r(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=
|
|
r.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,r.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;null!=(d=this[c]);c++)if(!a||r.filter(a,[d]).length)b||1!==d.nodeType||(r.cleanData(d.getElementsByTagName("*")),
|
|
r.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&&r.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 r.clone(this,a,b)})},html:function(a){return r.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return 1===c.nodeType?c.innerHTML.replace(Pa,""):null;if("string"===
|
|
typeof a&&!(za.test(a)||!r.support.leadingWhitespace&&ya.test(a)||ca[(Ra.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(Qa,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},1===c.nodeType&&(r.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(r.isFunction(a))return this.each(function(b){var c=r(this),d=c.html();c.replaceWith(a.call(this,b,d))});"string"!==typeof a&&(a=r(a).detach());
|
|
return this.each(function(){var b=this.nextSibling,c=this.parentNode;r(this).remove();b?r(b).before(a):r(c).append(a)})}return this.length?this.pushStack(r(r.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(!r.support.checkClone&&3===arguments.length&&"string"===typeof h&&Ta.test(h))return this.each(function(){r(this).domManip(a,c,d,!0)});if(r.isFunction(h))return this.each(function(e){var f=r(this);a[0]=h.call(this,
|
|
e,c?f.html():b);f.domManip(a,c,d)});if(this[0]){e=h&&h.parentNode;e=r.support.parentNode&&e&&11===e.nodeType&&e.childNodes.length===this.length?{fragment:e}:r.buildFragment(a,this,k);g=e.fragment;if(f=1===g.childNodes.length?g=g.firstChild:g.firstChild){c=c&&r.nodeName(f,"tr");f=0;for(var l=this.length,n=l-1;f<l;f++)d.call(c?r.nodeName(this[f],"table")?this[f].getElementsByTagName("tbody")[0]||this[f].appendChild(this[f].ownerDocument.createElement("tbody")):this[f]:this[f],e.cacheable||1<l&&f<n?
|
|
r.clone(g,!0,!0):g)}k.length&&r.each(k,function(a,b){b.src?r.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):r.globalEval((b.text||b.textContent||b.innerHTML||"").replace(Ua,"/*$0*/"));b.parentNode&&b.parentNode.removeChild(b)})}return this}});r.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=D);1===a.length&&"string"===typeof h&&512>h.length&&g===D&&"<"===h.charAt(0)&&!(db.test(h)||!r.support.checkClone&&Ta.test(h)||
|
|
!r.support.html5Clone&&Sa.test(h))&&(e=!0,(f=r.fragments[h])&&1!==f&&(d=f));d||(d=g.createDocumentFragment(),r.clean(a,g,d,c));e&&(r.fragments[h]=f?d:1);return{fragment:d,cacheable:e}};r.fragments={};r.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){r.fn[a]=function(c){var d=[];c=r(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();r(c[e])[b](g);d=d.concat(g)}return this.pushStack(d,a,c.selector)}});r.extend({clone:function(a,b,c){var d,e,f;r.support.html5Clone||r.isXMLDoc(a)||!Sa.test("<"+a.nodeName+">")?d=a.cloneNode(!0):(d=D.createElement("div"),Ba.appendChild(d),d.innerHTML=a.outerHTML,d=d.firstChild);var g=d;if(!(r.support.noCloneEvent&&r.support.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(q(a,g),d=n(a),e=n(g),f=0;d[f];++f)e[f]&&q(d[f],
|
|
e[f]);if(b&&(m(a,g),c))for(d=n(a),e=n(g),f=0;d[f];++f)m(d[f],e[f]);return g},clean:function(a,b,c,d){var e,f=[];b=b||D;"undefined"===typeof b.createElement&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||D);for(var g=0,h;null!=(h=a[g]);g++)if("number"===typeof h&&(h+=""),h){if("string"===typeof h)if(cb.test(h)){h=h.replace(Qa,"<$1></$2>");e=(Ra.exec(h)||["",""])[1].toLowerCase();var k=ca[e]||ca._default,n=k[0],m=b.createElement("div"),q=Ba.childNodes;b===D?Ba.appendChild(m):l(b).appendChild(m);for(m.innerHTML=
|
|
k[1]+h+k[2];n--;)m=m.lastChild;if(!r.support.tbody)for(n=bb.test(h),k="table"!==e||n?"<table>"!==k[1]||n?[]:m.childNodes:m.firstChild&&m.firstChild.childNodes,e=k.length-1;0<=e;--e)r.nodeName(k[e],"tbody")&&!k[e].childNodes.length&&k[e].parentNode.removeChild(k[e]);!r.support.leadingWhitespace&&ya.test(h)&&m.insertBefore(b.createTextNode(ya.exec(h)[0]),m.firstChild);h=m.childNodes;m&&(m.parentNode.removeChild(m),0<q.length&&(m=q[q.length-1])&&m.parentNode&&m.parentNode.removeChild(m))}else h=b.createTextNode(h);
|
|
var t;if(!r.support.appendChecked)if(h[0]&&"number"===typeof(t=h.length))for(e=0;e<t;e++)u(h[e]);else u(h);h.nodeType?f.push(h):f=r.merge(f,h)}if(c)for(a=function(a){return!a.type||Aa.test(a.type)},g=0;f[g];g++)b=f[g],d&&r.nodeName(b,"script")&&(!b.type||Aa.test(b.type))?d.push(b.parentNode?b.parentNode.removeChild(b):b):(1===b.nodeType&&(h=r.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=r.cache,e=r.event.special,
|
|
f=r.support.deleteExpando,g=0,h;null!=(h=a[g]);g++)if(!h.nodeName||!r.noData[h.nodeName.toLowerCase()])if(c=h[r.expando]){if((b=d[c])&&b.events){for(var k in b.events)e[k]?r.event.remove(h,k):r.removeEvent(h,k,b.handle);b.handle&&(b.handle.elem=null)}f?delete h[r.expando]:h.removeAttribute&&h.removeAttribute(r.expando);delete d[c]}}});var Ca=/alpha\([^)]*\)/i,eb=/opacity=([^)]*)/,Da=/([A-Z]|^ms)/g,Ea=/^[\-+]?(?:\d*\.)?\d+$/i,xa=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,Fa=/^([\-+])=([\-+.\de]+)/,Ga=/^margin/,
|
|
fb={position:"absolute",visibility:"hidden",display:"block"},ma=["Top","Right","Bottom","Left"],ia,Ha,Ia;r.fn.css=function(a,c){return r.access(this,function(a,c,d){return d!==b?r.style(a,c,d):r.css(a,c)},a,c,1<arguments.length)};r.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=ia(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":r.support.cssFloat?"cssFloat":
|
|
"styleFloat"},style:function(a,c,d,e){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var f,g=r.camelCase(c),h=a.style,k=r.cssHooks[g];c=r.cssProps[g]||g;if(d!==b){if(e=typeof d,"string"===e&&(f=Fa.exec(d))&&(d=+(f[1]+1)*+f[2]+parseFloat(r.css(a,c)),e="number"),!(null==d||"number"===e&&isNaN(d)||("number"!==e||r.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=r.camelCase(c);f=r.cssHooks[c];
|
|
c=r.cssProps[c]||c;"cssFloat"===c&&(c="float");if(f&&"get"in f&&(e=f.get(a,!0,d))!==b)return e;if(ia)return ia(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}});r.curCSS=r.css;D.defaultView&&D.defaultView.getComputedStyle&&(Ha=function(a,b){var c,d,e,f=a.style;b=b.replace(Da,"-$1").toLowerCase();(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),""!==c||r.contains(a.ownerDocument.documentElement,
|
|
a)||(c=r.style(a,b)));!r.support.pixelMargin&&e&&Ga.test(b)&&xa.test(c)&&(d=f.width,f.width=c,c=e.width,f.width=d);return c});D.documentElement.currentStyle&&(Ia=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;null==e&&f&&(c=f[b])&&(e=c);if(xa.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});ia=Ha||Ia;r.each(["height","width"],
|
|
function(a,b){r.cssHooks[b]={get:function(a,c,d){if(c)return 0!==a.offsetWidth?z(a,b,d):r.swap(a,fb,function(){return z(a,b,d)})},set:function(a,b){return Ea.test(b)?b+"px":b}}});r.support.opacity||(r.cssHooks.opacity={get:function(a,b){return eb.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=r.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(1<=b&&""===r.trim(f.replace(Ca,
|
|
""))&&(c.removeAttribute("filter"),d&&!d.filter))return;c.filter=Ca.test(f)?f.replace(Ca,e):f+" "+e}});r(function(){r.support.reliableMarginRight||(r.cssHooks.marginRight={get:function(a,b){return r.swap(a,{display:"inline-block"},function(){return b?ia(a,"margin-right"):a.style.marginRight})}})});r.expr&&r.expr.filters&&(r.expr.filters.hidden=function(a){var b=a.offsetHeight;return 0===a.offsetWidth&&0===b||!r.support.reliableHiddenOffsets&&"none"===(a.style&&a.style.display||r.css(a,"display"))},
|
|
r.expr.filters.visible=function(a){return!r.expr.filters.hidden(a)});r.each({margin:"",padding:"",border:"Width"},function(a,b){r.cssHooks[a+b]={expand:function(c){var d="string"===typeof c?c.split(" "):[c],e={};for(c=0;4>c;c++)e[a+ma[c]+b]=d[c]||d[c-2]||d[0];return e}}});var ha=/%20/g,Ja=/\[\]$/,Q=/\r?\n/g,da=/#.*$/,la=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,pb=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,rb=/^\/\//,
|
|
ib=/\?/,sb=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,tb=/^(?:select|textarea)/i,hb=/\s+/,ub=/([?&])_=[^&]*/,jb=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,kb=r.fn.load,Ya={},lb={},ta,ua,mb=["*/"]+["*"];try{ta=P.href}catch(Ab){ta=D.createElement("a"),ta.href="",ta=ta.href}ua=jb.exec(ta.toLowerCase())||[];r.fn.extend({load:function(a,c,d){if("string"!==typeof a&&kb)return kb.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&&(r.isFunction(c)?(d=c,c=b):"object"===typeof c&&(c=r.param(c,r.ajaxSettings.traditional),e="POST"));var g=this;r.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?r("<div>").append(c.replace(sb,"")).find(f):c));d&&g.each(d,[c,b,a])}});return this},serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?r.makeArray(this.elements):
|
|
this}).filter(function(){return this.name&&!this.disabled&&(this.checked||tb.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var c=r(this).val();return null==c?null:r.isArray(c)?r.map(c,function(a,c){return{name:b.name,value:a.replace(Q,"\r\n")}}):{name:b.name,value:c.replace(Q,"\r\n")}}).get()}});r.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){r.fn[b]=function(a){return this.on(b,a)}});r.each(["get","post"],function(a,c){r[c]=function(a,
|
|
d,e,f){r.isFunction(d)&&(f=f||e,e=d,d=b);return r.ajax({type:c,url:a,data:d,success:e,dataType:f})}});r.extend({getScript:function(a,c){return r.get(a,b,c,"script")},getJSON:function(a,b,c){return r.get(a,b,c,"json")},ajaxSetup:function(a,b){b?B(a,r.ajaxSettings):(b=a,a=r.ajaxSettings);B(a,b);return a},ajaxSettings:{url:ta,isLocal:/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/.test(ua[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","*":mb},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":r.parseJSON,"text xml":r.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:s(Ya),ajaxTransport:s(lb),ajax:function(a,c){function d(a,c,m,q){if(2!==u){u=2;B&&clearTimeout(B);w=b;t=q||"";Q.readyState=0<a?4:
|
|
0;var s,v,C;q=c;if(m){var G=e,M=Q,I=G.contents,A=G.dataTypes,L=G.responseFields,E,J,da,R;for(J in L)J in m&&(M[L[J]]=m[J]);for(;"*"===A[0];)A.shift(),E===b&&(E=G.mimeType||M.getResponseHeader("content-type"));if(E)for(J in I)if(I[J]&&I[J].test(E)){A.unshift(J);break}if(A[0]in m)da=A[0];else{for(J in m){if(!A[0]||G.converters[J+" "+A[0]]){da=J;break}R||(R=J)}da=da||R}da?(da!==A[0]&&A.unshift(da),m=m[da]):m=void 0}else m=b;if(200<=a&&300>a||304===a){if(e.ifModified){if(E=Q.getResponseHeader("Last-Modified"))r.lastModified[n]=
|
|
E;if(E=Q.getResponseHeader("Etag"))r.etag[n]=E}if(304===a)q="notmodified",s=!0;else try{E=e;E.dataFilter&&(m=E.dataFilter(m,E.dataType));var K=E.dataTypes;J={};var D,T,F=K.length,N,pa=K[0],O,Z,la,X,P;for(D=1;D<F;D++){if(1===D)for(T in E.converters)"string"===typeof T&&(J[T.toLowerCase()]=E.converters[T]);O=pa;pa=K[D];if("*"===pa)pa=O;else if("*"!==O&&O!==pa){Z=O+" "+pa;la=J[Z]||J["* "+pa];if(!la)for(X in P=b,J)if(N=X.split(" "),N[0]===O||"*"===N[0])if(P=J[N[1]+" "+pa]){X=J[X];!0===X?la=P:!0===P&&
|
|
(la=X);break}la||P||r.error("No conversion from "+Z.replace(" "," to "));!0!==la&&(m=la?la(m):P(X(m)))}}v=m;q="success";s=!0}catch(W){q="parsererror",C=W}}else if(C=q,!q||a)q="error",0>a&&(a=0);Q.status=a;Q.statusText=""+(c||q);s?h.resolveWith(f,[v,q,Q]):h.rejectWith(f,[Q,q,C]);Q.statusCode(l);l=b;z&&g.trigger("ajax"+(s?"Success":"Error"),[Q,e,s?v:C]);k.fireWith(f,[Q,q]);z&&(g.trigger("ajaxComplete",[Q,e]),--r.active||r.event.trigger("ajaxStop"))}}"object"===typeof a&&(c=a,a=b);c=c||{};var e=r.ajaxSetup({},
|
|
c),f=e.context||e,g=f!==e&&(f.nodeType||f instanceof r)?r(f):r.event,h=r.Deferred(),k=r.Callbacks("once memory"),l=e.statusCode||{},n,m={},q={},t,s,w,B,v,u=0,z,C,Q={readyState:0,setRequestHeader:function(a,b){if(!u){var c=a.toLowerCase();a=q[c]=q[c]||a;m[a]=b}return this},getAllResponseHeaders:function(){return 2===u?t:null},getResponseHeader:function(a){var c;if(2===u){if(!s)for(s={};c=la.exec(t);)s[c[1].toLowerCase()]=c[2];c=s[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){u||
|
|
(e.mimeType=a);return this},abort:function(a){a=a||"abort";w&&w.abort(a);d(0,a);return this}};h.promise(Q);Q.success=Q.done;Q.error=Q.fail;Q.complete=k.add;Q.statusCode=function(a){if(a){var b;if(2>u)for(b in a)l[b]=[l[b],a[b]];else b=a[Q.status],Q.then(b,b)}return this};e.url=((a||e.url)+"").replace(da,"").replace(rb,ua[1]+"//");e.dataTypes=r.trim(e.dataType||"*").toLowerCase().split(hb);null==e.crossDomain&&(v=jb.exec(e.url.toLowerCase()),e.crossDomain=!(!v||v[1]==ua[1]&&v[2]==ua[2]&&(v[3]||("http:"===
|
|
v[1]?80:443))==(ua[3]||("http:"===ua[1]?80:443))));e.data&&e.processData&&"string"!==typeof e.data&&(e.data=r.param(e.data,e.traditional));A(Ya,e,c,Q);if(2===u)return!1;z=e.global;e.type=e.type.toUpperCase();e.hasContent=!qb.test(e.type);z&&0===r.active++&&r.event.trigger("ajaxStart");if(!e.hasContent&&(e.data&&(e.url+=(ib.test(e.url)?"&":"?")+e.data,delete e.data),n=e.url,!1===e.cache)){v=r.now();var G=e.url.replace(ub,"$1_="+v);e.url=G+(G===e.url?(ib.test(e.url)?"&":"?")+"_="+v:"")}(e.data&&e.hasContent&&
|
|
!1!==e.contentType||c.contentType)&&Q.setRequestHeader("Content-Type",e.contentType);e.ifModified&&(n=n||e.url,r.lastModified[n]&&Q.setRequestHeader("If-Modified-Since",r.lastModified[n]),r.etag[n]&&Q.setRequestHeader("If-None-Match",r.etag[n]));Q.setRequestHeader("Accept",e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+("*"!==e.dataTypes[0]?", "+mb+"; q=0.01":""):e.accepts["*"]);for(C in e.headers)Q.setRequestHeader(C,e.headers[C]);if(e.beforeSend&&(!1===e.beforeSend.call(f,Q,
|
|
e)||2===u))return Q.abort(),!1;for(C in{success:1,error:1,complete:1})Q[C](e[C]);if(w=A(lb,e,c,Q)){Q.readyState=1;z&&g.trigger("ajaxSend",[Q,e]);e.async&&0<e.timeout&&(B=setTimeout(function(){Q.abort("timeout")},e.timeout));try{u=1,w.send(m,d)}catch(M){if(2>u)d(-1,M);else throw M;}}else d(-1,"No Transport");return Q},param:function(a,c){var d=[],e=function(a,b){b=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=r.ajaxSettings.traditional);if(r.isArray(a)||
|
|
a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(var f in a)w(f,a[f],c,e);return d.join("&").replace(ha,"+")}});r.extend({active:0,lastModified:{},etag:{}});var vb=r.now(),Va=/(\=)\?(&|$)|\?\?/i;r.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return r.expando+"_"+vb++}});r.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&&(Va.test(b.url)||
|
|
c&&Va.test(b.data))){var e,f=b.jsonpCallback=r.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(Va,l),b.url===h&&(c&&(k=k.replace(Va,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&&r.isFunction(g))a[f](e[0])});b.converters["script json"]=function(){e||r.error(f+" was not called");return e[0]};b.dataTypes[0]="json";return"script"}});r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},
|
|
contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){r.globalEval(a);return a}}});r.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1);a.crossDomain&&(a.type="GET",a.global=!1)});r.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=D.head||D.getElementsByTagName("head")[0]||D.documentElement;return{send:function(e,f){c=D.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 gb=a.ActiveXObject?function(){for(var a in wa)wa[a](0,1)}:!1,wb=0,wa;r.ajaxSettings.xhr=a.ActiveXObject?function(){var b;if(!(b=!this.isLocal&&v()))a:{try{b=new a.ActiveXObject("Microsoft.XMLHTTP");break a}catch(c){}b=void 0}return b}:v;(function(a){r.extend(r.support,
|
|
{ajax:!!a,cors:!!a&&"withCredentials"in a})})(r.ajaxSettings.xhr());r.support.ajax&&r.ajaxTransport(function(c){if(!c.crossDomain||r.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,n,m,q;try{if(d&&(e||4===g.readyState))if(d=b,h&&(g.onreadystatechange=r.noop,gb&&delete wa[h]),e)4!==g.readyState&&g.abort();else{k=g.status;n=g.getAllResponseHeaders();m={};(q=g.responseXML)&&q.documentElement&&(m.xml=q);try{m.text=g.responseText}catch(t){}try{l=g.statusText}catch(s){l=""}k||!c.isLocal||c.crossDomain?1223===k&&(k=204):k=m.text?200:404}}catch(w){e||f(-1,w)}m&&f(k,l,m,n)};c.async&&4!==g.readyState?(h=++wb,gb&&
|
|
(wa||(wa={},r(a).unload(gb)),wa[h]=d),g.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var Za={},ja,va,xb=/^(?:toggle|show|hide)$/,yb=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,Wa,La=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],Ka;r.fn.extend({show:function(a,b,c){if(a||0===a)return this.animate(I("show",3),a,b,c);c=0;for(var d=this.length;c<d;c++)a=this[c],a.style&&(b=a.style.display,r._data(a,
|
|
"olddisplay")||"none"!==b||(b=a.style.display=""),(""===b&&"none"===r.css(a,"display")||!r.contains(a.ownerDocument.documentElement,a))&&r._data(a,"olddisplay",E(a.nodeName)));for(c=0;c<d;c++)if(a=this[c],a.style&&(b=a.style.display,""===b||"none"===b))a.style.display=r._data(a,"olddisplay")||"";return this},hide:function(a,b,c){if(a||0===a)return this.animate(I("hide",3),a,b,c);c=0;for(var d=this.length;c<d;c++)a=this[c],a.style&&(b=r.css(a,"display"),"none"===b||r._data(a,"olddisplay")||r._data(a,
|
|
"olddisplay",b));for(c=0;c<d;c++)this[c].style&&(this[c].style.display="none");return this},_toggle:r.fn.toggle,toggle:function(a,b,c){var d="boolean"===typeof a;r.isFunction(a)&&r.isFunction(b)?this._toggle.apply(this,arguments):null==a||d?this.each(function(){var b=d?a:r(this).is(":hidden");r(this)[b?"show":"hide"]()}):this.animate(I("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&&r._mark(this);var b=r.extend({},f),c=1===this.nodeType,d=c&&r(this).is(":hidden"),g,h,k,l,n;b.animatedProperties={};for(k in a)if(g=r.camelCase(k),k!==g&&(a[g]=a[k],delete a[k]),(h=r.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];r.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"===r.css(this,"display")&&"none"===r.css(this,"float")&&(r.support.inlineBlockNeedsLayout&&"inline"!==E(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 r.fx(this,b,k),h=a[k],xb.test(h))if(g=r._data(this,"toggle"+k)||("toggle"===h?d?"show":"hide":0))r._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]),n=g[3]||(r.cssNumber[k]?"":"px"),"px"!==n&&(r.style(this,k,(h||1)+n),l*=(h||1)/c.cur(),r.style(this,k,l+n)),g[1]&&(h=("-="===g[1]?-1:1)*h+l),c.custom(l,h,n)):c.custom(l,h,"");return!0}var f=r.speed(b,c,d);if(r.isEmptyObject(a))return this.each(f.complete,[!1]);a=r.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=r.timers,f=r._data(this);d||r._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];r.removeData(this,b,!0);g.stop(d)}}else f[b=a+".run"]&&f[b].stop&&(f=f[b],r.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||r.dequeue(this,a)})}});r.each({slideDown:I("show",1),slideUp:I("hide",1),slideToggle:I("toggle",1),fadeIn:{opacity:"show"},
|
|
fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){r.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}});r.extend({speed:function(a,b,c){var d=a&&"object"===typeof a?r.extend({},a):{complete:c||!c&&b||r.isFunction(a)&&a,duration:a,easing:c&&b||b&&!r.isFunction(b)&&b};d.duration=r.fx.off?0:"number"===typeof d.duration?d.duration:d.duration in r.fx.speeds?r.fx.speeds[d.duration]:r.fx.speeds._default;if(null==d.queue||!0===d.queue)d.queue="fx";d.old=d.complete;d.complete=function(a){r.isFunction(d.old)&&
|
|
d.old.call(this);d.queue?r.dequeue(this,d.queue):!1!==a&&r._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+0.5}},timers:[],fx:function(a,b,c){this.options=b;this.elem=a;this.prop=c;b.orig=b.orig||{}}});r.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(r.fx.step[this.prop]||r.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=r.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=r.fx;this.startTime=Ka||C();this.end=c;this.now=this.start=a;this.pos=this.state=0;this.unit=d||this.unit||(r.cssNumber[this.prop]?"":"px");e.queue=this.options.queue;e.elem=this.elem;e.saveState=function(){r._data(f.elem,"fxshow"+f.prop)===b&&(f.options.hide?r._data(f.elem,"fxshow"+f.prop,f.start):f.options.show&&r._data(f.elem,"fxshow"+f.prop,f.end))};
|
|
e()&&r.timers.push(e)&&!Wa&&(Wa=setInterval(g.tick,g.interval))},show:function(){var a=r._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||r.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());r(this.elem).show()},hide:function(){this.options.orig[this.prop]=r._data(this.elem,"fxshow"+this.prop)||r.style(this.elem,this.prop);this.options.hide=!0;this.custom(this.cur(),0)},step:function(a){var b,
|
|
c=Ka||C(),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||r.support.shrinkWrapBlocks||r.each(["","X","Y"],function(a,b){e.style["overflow"+b]=f.overflow[a]});f.hide&&r(e).hide();if(f.hide||f.show)for(b in f.animatedProperties)r.style(e,b,f.orig[b]),r.removeData(e,"fxshow"+b,!0),r.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=r.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}};r.extend(r.fx,{tick:function(){for(var a,b=r.timers,c=0;c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||r.fx.stop()},interval:13,stop:function(){clearInterval(Wa);Wa=null},speeds:{slow:600,fast:200,
|
|
_default:400},step:{opacity:function(a){r.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}}});r.each(La.concat.apply([],La),function(a,b){b.indexOf("margin")&&(r.fx.step[b]=function(a){r.style(a.elem,b,Math.max(0,a.now)+a.unit)})});r.expr&&r.expr.filters&&(r.expr.filters.animated=function(a){return r.grep(r.timers,function(b){return a===b.elem}).length});var nb,zb=/^t(?:able|d|h)$/i,ob=/^(?:body|html)$/i;
|
|
nb="getBoundingClientRect"in D.documentElement?function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!r.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};a=b.body;b=K(b);return{top:d.top+(b.pageYOffset||r.support.boxModel&&c.scrollTop||a.scrollTop)-(c.clientTop||a.clientTop||0),left:d.left+(b.pageXOffset||r.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&&(!r.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,!r.support.doesNotAddBorder||r.support.doesAddBorderForTableAndCells&&zb.test(a.nodeName)||(g+=parseFloat(d.borderTopWidth)||0,h+=parseFloat(d.borderLeftWidth)||0),e=a.offsetParent),r.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;r.support.fixedPosition&&"fixed"===d.position&&(g+=Math.max(c.scrollTop,f.scrollTop),h+=Math.max(c.scrollLeft,f.scrollLeft));return{top:g,left:h}};r.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){r.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;return d?c===d.body?r.offset.bodyOffset(c):nb(c,d,
|
|
d.documentElement):null};r.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;r.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(r.css(a,"marginTop"))||0,c+=parseFloat(r.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=r.css(a,"position");"static"===d&&(a.style.position="relative");var e=r(a),f=e.offset(),g=r.css(a,"top"),h=r.css(a,"left"),k={},l={};("absolute"===d||"fixed"===d)&&-1<r.inArray("auto",[g,h])?(l=e.position(),d=l.top,h=l.left):(d=parseFloat(g)||
|
|
0,h=parseFloat(h)||0);r.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)}};r.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=ob.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(r.css(a,"marginTop"))||0;c.left-=parseFloat(r.css(a,"marginLeft"))||0;d.top+=parseFloat(r.css(b[0],"borderTopWidth"))||0;d.left+=parseFloat(r.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||D.body;a&&!ob.test(a.nodeName)&&"static"===r.css(a,"position");)a=a.offsetParent;return a})}});r.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);r.fn[a]=function(e){return r.access(this,function(a,e,f){var g=K(a);if(f===b)return g?c in g?g[c]:r.support.boxModel&&g.document.documentElement[e]||g.document.body[e]:a[e];
|
|
g?g.scrollTo(d?r(g).scrollLeft():f,d?f:r(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}});r.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,f="offset"+a;r.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(r.css(a,c,"padding")):this[c]():null};r.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(r.css(b,c,a?"margin":"border")):this[c]():null};r.fn[c]=function(a){return r.access(this,function(a,c,g){if(r.isWindow(a))return c=a.document,
|
|
a=c.documentElement[d],r.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=r.css(a,c),c=parseFloat(a),r.isNumeric(c)?c:a;r(a).css(c,g)},c,a,arguments.length,null)}});a.jQuery=a.$=r;"function"===typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return r})})(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=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,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}}var d=!0;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,f){function g(){var b,c=this.attr("id").split("_")[1];for(b in m._state)b!==c&&m._state.hasOwnProperty(b)&&a(":input[sb='"+b+"']")[0]&&m._closeSelectbox(a(":input[sb='"+b+"']")[0])}function h(b){l.children().each(function(d){if(a(this).is(":selected")){if(38==b&&0<d)return d=a(l.children()[d-1]),m._changeSelectbox(c,d.val(),d.text()),!1;if(40==b&&d<l.children().length-1)return d=a(l.children()[d+1]),m._changeSelectbox(c,d.val(),d.text()),
|
|
!1}})}function k(f,g){var h=g&&g.sub?!0:!1,k=g&&g.disabled?!0:!1;f.each(function(f){var g=a(this),l=a("<li>"),n;g.is(":selected")&&(t.text(g.text()),s=d);f===B-1&&l.addClass("last");(function(){var d=g.text(),f=g.data("custom-option-text"),f=f!=b?f:d;g.is(":disabled")||k?n=a("<span>",{text:f}).addClass(q.settings.classDisabled):(n=a("<a>",{href:"#"+g.val(),rel:g.val(),text:f,click:function(b){b.preventDefault();b=u;b.attr("id").split("_");m._closeSelectbox(c);m._changeSelectbox(c,a(this).attr("rel"),
|
|
d);b.focus()}}),g.is(":selected")&&n.addClass("active"));h&&n.addClass(q.settings.classSub);n.appendTo(l)})();l.appendTo(z)})}if(this._getInst(c))return!1;var l=a(c),m=this,q=m._newInst(l),n,t,u,z,s=!1;l.find("optgroup");var A=l.find("option"),B=A.length;l.attr("sb",q.uid);a.extend(q.settings,m._defaults,f);m._state[q.uid]=!1;l.hide();n=a("<div>",{id:"sbHolder_"+q.uid,"class":q.settings.classHolder});var w=l.data("selectbox-css");w&&n.css(w);t=a("<a>",{id:"sbSelector_"+q.uid,href:"#","class":q.settings.classSelector,
|
|
click:function(b){b.preventDefault();b.stopPropagation();g.apply(a(this),[]);b=a(this).attr("id").split("_")[1];m._state[b]?m._closeSelectbox(c):(m._openSelectbox(c),u.focus())},keyup:function(a){h(a.keyCode)}});u=a("<a>",{id:"sbToggle_"+q.uid,href:"#","class":q.settings.classToggle,click:function(b){b.preventDefault();b.stopPropagation();g.apply(a(this),[]);b=a(this).attr("id").split("_")[1];m._state[b]?m._closeSelectbox(c):(m._openSelectbox(c),u.focus())},keyup:function(a){h(a.keyCode)}});u.appendTo(n);
|
|
z=a("<ul>",{id:"sbOptions_"+q.uid,"class":q.settings.classOptions,css:{display:"none"}});l.children().each(function(b){b=a(this);var c,d={};b.is("option")?k(b):b.is("optgroup")&&(c=a("<li>"),a("<span>",{text:b.attr("label")}).addClass(q.settings.classGroup).appendTo(c),c.appendTo(z),b.is(":disabled")&&(d.disabled=!0),d.sub=!0,k(b.find("option"),d))});s||t.text(A.first().text());a.data(c,"selectbox",q);t.appendTo(n);z.appendTo(n);n.insertAfter(l);l.is(":disabled")&&a.selectbox._disableSelectbox(c);
|
|
l.change(function(){var b=a(this).val(),d=l.find("option[value='"+b+"']").text();m._changeSelectbox(c,b,d)})},_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,g){var h=this._getInst(b),k=this._get(h,"onChange");alreadySelected=a("#sbSelector_"+h.uid).text()===g&&a("#sbOptions_"+h.uid).find('a[rel="'+c+'"]').hasClass("active");alreadySelected||(a("#sbSelector_"+
|
|
h.uid).text(g),a("#sbOptions_"+h.uid).find(".active").removeClass("active"),a("#sbOptions_"+h.uid).find('a[rel="'+c+'"]').addClass("active"),a(b).find("option").attr("selected",!1),a(b).find("option[value='"+c+"']").attr("selected",d),k?k.apply(h.input?h.input[0]:null,[c,h]):h.input&&h.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=d;a.data(b,"selectbox",c)},_optionSelectbox:function(b,c,d){var h=this._getInst(b);if(!h)return!1;h[c]=d;a.data(b,"selectbox",h)},_openSelectbox:function(b){var c=this._getInst(b),g=this;if(c&&!c.isOpen&&!c.isDisabled){var h=a("#sbOptions_"+c.uid),k=parseInt(a(window).height(),10),l=parseInt(a(window).width(),10),m=a("#sbHolder_"+c.uid).offset(),
|
|
q=a(window).scrollTop(),n=h.prev().height(),k=k-(m.top-q)-n/2,t=this._get(c,"onOpen");50<k&&!c.settings.slidesUp?h.css({bottom:"auto",top:n+2+"px",maxHeight:k-n+"px"}):h.css({top:"auto",bottom:n+2+"px",maxHeight:m.top-q-n/2+"px"});m.left+h.width()>l?h.css("left","-"+(h.width()-h.parent().width()+3)+"px"):h.css("left","-1px");"fade"===c.settings.effect?h.fadeIn(c.settings.speed):h.slideDown(c.settings.speed);a("#sbToggle_"+c.uid).addClass(c.settings.classToggleOpen);a("#sbHolder_"+c.uid).addClass(c.settings.classHolderOpen);
|
|
this._state[c.uid]=d;c.isOpen=d;t&&t.apply(c.input?c.input[0]:null,[c]);a.data(b,"selectbox",c);a("html").unbind("click.sbClose").one("click.sbClose",function(){g._closeSelectbox(b)})}},_closeSelectbox:function(b){var c=this._getInst(b);if(c&&c.isOpen){var d=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;d&&d.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="hidden",d="fontFamily fontSize fontWeight fontStyle letterSpacing textTransform wordSpacing".split(" "),e=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];e.setAttribute("oninput","return");a.isFunction(e.oninput)||"onpropertychange"in e?a.fn.autosize=function(b){return this.each(function(){function e(){var a,b;n||(n=!0,
|
|
l.value=h.value,l.style.overflowY=h.style.overflowY,l.style.width=k.css("width"),l.style.textIndent=k.css("text-indent"),l.scrollTop=0,l.scrollTop=9E4,a=l.scrollTop,b=c,a>q?(a=q,b="scroll"):a<m&&(a=m),h.style.overflowY=b,h.style.height=h.style.minHeight=h.style.maxHeight=a+u+"px",setTimeout(function(){n=!1},1));k.trigger("autosizeComplete")}for(var h=this,k=a(h).css({overflow:c,overflowY:c,wordWrap:"break-word"}),l=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],m=k.height(),q=parseInt(k.css("maxHeight"),10),n,t=d.length,u="border-box"===k.css("box-sizing")?k.outerHeight()-k.height():0,q=q&&0<q?q:9E4;t--;)l.style[d[t]]=k.css(d[t]);a("body").append(l);"onpropertychange"in h?"oninput"in h?h.oninput=h.onkeyup=e:h.onpropertychange=e:h.oninput=e;a(window).resize(e);k.bind("autosize",e);e()})}:a.fn.autosize=function(){return this}})(jQuery);(function(a,b,c){function d(){g=b[h](function(){e.each(function(){var b=a(this),c=b.width(),d=b.height(),e=a.data(this,l);c===e.w&&d===e.h||b.trigger(k,[e.w=c,e.h=d])});d()},f[m])}"$:nomunge";var e=a([]),f=a.resize=a.extend(a.resize,{}),g,h="setTimeout",k="resize",l=k+"-special-event",m="delay";f[m]=250;f.throttleWindow=!0;a.event.special[k]={setup:function(){if(!f.throttleWindow&&this[h])return!1;var b=a(this);e=e.add(b);a.data(this,l,{w:b.width(),h:b.height()});1===e.length&&d()},teardown:function(){if(!f.throttleWindow&&
|
|
this[h])return!1;var b=a(this);e=e.not(b);b.removeData(l);e.length||clearTimeout(g)},add:function(b){function d(b,f,g){var h=a(this),k=a.data(this,l);k.w=f!==c?f:h.width();k.h=g!==c?g:h.height();e.apply(this,arguments)}if(!f.throttleWindow&&this[h])return!1;var e;if(a.isFunction(b))return e=b,d;e=b.handler;b.handler=d}}})(jQuery,this);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+" "+q.join(g+" ")+g).split(" ");if(d(b,"string")||d(b,"undefined"))b=e(h,b);else a:{h=(a+" "+n.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(" "),q=["Webkit","Moz","O","ms"],n=["webkit","moz","o","ms"],k={},t=[],u=t.slice,z,s=function(a,c,d,e){var f,g,k,l,n=b.createElement("div"),m=b.body,q=m||b.createElement("body");if(parseInt(d,10))for(;d--;)k=b.createElement("div"),k.id=e?e[d]:"modernizr"+(d+1),n.appendChild(k);return f=['­<style id="smodernizr">',a,"</style>"].join(""),n.id="modernizr",(m?n:q).innerHTML+=f,q.appendChild(n),m||(q.style.background="",
|
|
q.style.overflow="hidden",l=h.style.overflow,h.style.overflow="hidden",h.appendChild(q)),g=c(n,a),m?n.parentNode.removeChild(n):(q.parentNode.removeChild(q),h.style.overflow=l),!!g},A=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}}(),B={}.hasOwnProperty,w;d(B,"undefined")||d(B.call,"undefined")?w=function(a,b){return b in a&&d(a.constructor.prototype[b],"undefined")}:w=function(a,b){return B.call(a,b)};Function.prototype.bind||(Function.prototype.bind=function(a){var b=this;if("function"!=typeof b)throw new TypeError;var c=u.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(u.call(arguments)));
|
|
return Object(f)===f?f:e}return b.apply(a,c.concat(u.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:s(["@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 v in k)w(k,v)&&(z=v.toLowerCase(),g[z]=k[v](),t.push((g[z]?"":"no-")+z));g.addTest=function(a,b){if("object"==typeof a)for(var d in a)w(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=
|
|
n,g._cssomPrefixes=q,g.hasEvent=A,g.testProp=function(a){return e([a])},g.testAllProps=f,g.testStyles=s,h.className=h.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(" feature-js feature-"+t.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 q(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 n(b){t.call(this,b);a(this).removeData("tvcolorpicker").removeData("tvcolorpicker-custom-color");B()}function t(b){var c=a(this);c.val(b);c.change();b?
|
|
c.trigger("pick-color",b):c.trigger("pick-transparent");u.call(this,b)}function u(b){a(this).css({backgroundColor:b,color:b})}function z(c,d){var f=this,g=a(f).val().toLowerCase(),h=document.createElement("table"),l=document.createElement("tbody");h.appendChild(l);var m,q=0;a.each(c,function(c,h){q++;0==c%k&&(m=a("<tr></tr>").appendTo(l));var t=a('<td class="tvcolorpicker-cell"></td>').appendTo(m),t=a('<div class="tvcolorpicker-swatch"></div>').appendTo(t);d&&d.addClass&&t.addClass(d.addClass);if(h){h=
|
|
h.toLowerCase();g==h&&t.addClass("active");t.css({backgroundColor:h}).data("color",h);t.bind("click",function(){n.call(f,h)});var s=b.apply(this,e(h));0.9<(1-s[1])*s[2]&&t.addClass("low-contrast")}});a(h).addClass("tvcolorpicker-table");return q?h:a()}function s(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(),n=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+n>k+f&&(d.top=k-n+f);e.left+l>b&&(d.left=b-l);d.left+="px";d.top+="px";c.css(d)}function A(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;A.css({left:d+"px",top:a+"px"});U[0]=d/W;U[1]=1-a/O;N.css({backgroundColor:f(c(U[0],U[1],1))});m()}function h(b){1==b.which&&(Z=!1,w.is(".opened")&&a(q).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;T.css({top:a+"px"});U[2]=1-a/O;m()}function n(b){1==b.which&&(X=!1,a(document).unbind("mouseup",n),w.is(".opened")&&a(q).get(0).focus())}function m(){aa&&(aa=!1,w.find(".tvcolorpicker-swatch.active").removeClass("active"));var a=f(c(U[0],U[1],U[2]));q.val().toUpperCase()!=a.toUpperCase()&&(q.data("tvcolorpicker-custom-color",a),t.call(q,a))}var q=a(this),w=a('<div class="tvcolorpicker-popup opened">'),
|
|
B=a('<div class="tvcolorpicker-swatches-area"></div>').appendTo(w);B.append(z.call(this,"#000000 #424242 #656565 #989898 #b6b6b6 #cbcbcb #d8d8d8 #eeeeee #f2f2f2 #ffffff".split(" ")));B.append(z.call(this,"#970000 #ff0000 #ff9800 #ffff00 #00ff00 #00ffff #4985e7 #0000ff #9800ff #ff00ff".split(" ")));B.append(z.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 r=a('<div class="tvcolorpicker-custom-area"></div>').css({display:"none"}).appendTo(w),u=a('<div class="tvcolorpicker-hsv"></div>').appendTo(r),M=a('<div class="tvcolorpicker-hs"></div>').appendTo(u),A=a('<div class="tvcolorpicker-hs-handle"></div>').appendTo(M),J=a('<div class="tvcolorpicker-hs-area"></div>').appendTo(M),N=a('<div class="tvcolorpicker-v"></div>').appendTo(u),T=a('<div class="tvcolorpicker-v-handle"></div>').appendTo(N),u=a('<div class="tvcolorpicker-v-area"></div>').appendTo(N),
|
|
O=M.height(),W=M.width(),Z=!1,X=!1,aa=!0,U=[0,0,0.5];J.bind("mousedown",function(b){1==b.which&&(Z=!0,a(document).bind("mouseup",h),g(b),b.preventDefault())});J.bind("mousemove",function(a){Z&&(g(a),a.preventDefault())});u.bind("mousedown",function(b){1==b.which&&(X=!0,a(document).bind("mouseup",n),k(b),b.preventDefault())});u.bind("mousemove",function(a){X&&(k(a),a.preventDefault())});a('<a class="tvcolorpicker-custom-button tv-button">'+a.t("Custom color...")+"</a>").appendTo(w).bind("click",function(){var d=
|
|
a(this).is(".active");d||r.css({minWidth:B.width()+"px",minHeight:B.height()+"px"});a(this)[d?"removeClass":"addClass"]("active");r.css({display:d?"none":"block"});B.css({display:d?"block":"none"});d?q.removeData("tvcolorpicker-custom-color"):(O=M.height(),W=M.width(),d=e(q.val()),U=b.apply(this,d),A.css({left:~~(U[0]*W)+"px",top:~~((1-U[1])*O)+"px"}),T.css({top:~~((1-U[2])*O)+"px"}),N.css({backgroundColor:f(c(U[0],U[1],1))}))});w.append(a(z.call(this,l,{addClass:"tvcolorpicker-user"})).addClass("tvcolorpicker-user-swatches"));
|
|
a(document.body).append(w);s(q,w,d);return w}function B(){a(".tvcolorpicker-popup").removeClass("opened").remove();a(w).data("tvcolorpicker",null);a(w).each(function(){var b=a(this).data("tvcolorpicker-custom-color");b&&(q(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 w=
|
|
this;m&&"customColors"in m&&g(m.customColors);return this.each(function(){function b(){var a=d(c.val());u.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=A.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():B.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 w[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||t(a)&&0===a.length)f+=c()}else if(t(a))u(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,n=!1,m=function(){if(!l||n||d.space)k=[];else for(;k.length;)h.splice(k.pop(),1);n=l=!1},q=[],t,w,B,v=function(a){e=s(a).split(/\s+/);w=e[0];B=e[e.length-1]},u=function(a){h.push('";',t,'\nvar partial = partials["'+s(a)+'"];',"\nif (partial) {","\n buffer += render(partial,stack[stack.length - 1],partials);","\n}",'\nbuffer += "')},A=function(a,e){var f=s(a);if(""===
|
|
f)throw c(Error("Section name may not be empty"),b,Y,d.file);q.push({name:f,inverted:e});h.push('";',t,'\nvar name = "'+f+'";',"\nvar callback = (function () {","\n return function () {",'\n var buffer = "";','\nbuffer += "')},Z=function(a){A(a,!0)},X=function(a){a=s(a);var e=0!=q.length&&q[q.length-1].name;if(!e||a!=e)throw c(Error('Section named "'+a+'" was never opened'),b,Y,d.file);a=q.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('";',t,'\nbuffer += lookup("'+s(a)+'",stack,"");','\nbuffer += "')},U=function(a){h.push('";',t,'\nbuffer += escapeHTML(lookup("'+s(a)+'",stack,""));','\nbuffer += "')},Y=1,H,S,V=0,ea=b.length;V<ea;++V)if(b.slice(V,V+f.length)===f){V+=f.length;H=b.substr(V,1);t="\nline = "+Y+";";w=f;B=g;l=!0;switch(H){case "!":V++;S=null;break;case "=":V++;g="="+g;S=v;break;case ">":V++;S=u;break;case "#":V++;
|
|
S=A;break;case "^":V++;S=Z;break;case "/":V++;S=X;break;case "{":g="}"+g;case "&":V++;n=!0;S=aa;break;default:n=!0,S=U}H=b.indexOf(g,V);if(-1===H)throw c(Error('Tag "'+f+'" was not closed properly'),b,Y,d.file);f=b.substring(V,H);S&&S(f);for(S=0;~(S=f.indexOf("\n",S));)Y++,S++;V=H+g.length-1;f=w;g=B}else switch(H=b.substr(V,1),H){case '"':case "\\":n=!0;h.push("\\"+H);break;case "\r":break;case "\n":k.push(h.length);h.push("\\n");m();Y++;break;default:z.test(H)?k.push(h.length):n=!0,h.push(H)}if(0!=
|
|
q.length)throw c(Error('Section "'+q[q.length-1].name+'" was not closed properly'),b,Y,d.file);m();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 n=[f];try{return l(f,h,
|
|
n,d,b,e,k)}catch(m){throw c(m.error,a,m.line,g.file);}}}function h(a,b){b=b||{};return!1!==b.cache?(v[a]||(v[a]=g(a,b)),v[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(){v={}};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,q=Array.prototype.forEach,n=String.prototype.trim,t;t=m?m:function(a){return"[object Array]"===
|
|
l.call(a)};var u;u=q?function(a,b,c){return q.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 z=/^\s*$/,s;if(n)s=function(a){return null==a?"":n.call(a)};else{var A,B;z.test("\u00a0")?(A=/^\s+/,B=/\s+$/):(A=/^[\s\xA0]+/,B=/[\s\xA0]+$/);s=function(a){return null==a?"":String(a).replace(A,"").replace(B,"")}}var w={"&":"&","<":"<",">":">",'"':""","'":"'"},v={}})(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)if(g=b[f]+(c[0].toUpperCase()+c.slice(1)),g=g[0].toLowerCase()+g.slice(1),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(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(q);a.removeData(n)}function d(b){var d=b.data(q);d&&(!0!==d?(d--,d?(e(b),b.data(q,d)):(d=b.data(n).complete,c(b),d&&a.isFunction(d)&&d())):e(b))}function e(a){var b=a.css("background-color"),c=a.data(n),e=c.duration||u,f=c.easing||z;a.animate({"background-color":c.highlightColor||t},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",""],q="flicker-enable",n="flicker-options",t="#fbf8e9",u=400,z="swing";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(q,d);c.data(n,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(d,e,f,g,h){var k=d.contents(),l=!1;d.empty();for(var m=0,q=k.length;q>m&&!l;m++){var C=k[m],G=a(C);"undefined"!=typeof C&&(d.append(G),h&&d[d.is("table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style")?"after":"append"](h),3==C.nodeType?f.innerHeight()>g.maxHeight&&(l=c(G,e,f,g,h)):l=b(G,e,f,g,h),l||h&&h.detach())}return l}function c(a,b,e,h,k){var l=!1,m=a[0];if("undefined"==typeof m)return!1;
|
|
for(var q=g(m),v=-1!==q.indexOf(" ")?" ":"\u3000",v="letter"==h.wrap?"":v,q=q.split(v),C=-1,G=-1,I=0,E=q.length-1;E>=I;){var K=Math.floor((I+E)/2);if(K==G)break;G=K;f(m,q.slice(0,G+1).join(v)+h.ellipsis);e.innerHeight()>h.maxHeight?E=G:(C=G,I=G);E==I&&0==E&&h.fallbackToLetter&&(v="",q=q[0].split(v),C=-1,G=-1,I=0,E=q.length-1)}-1==C||1==q.length&&0==q[0].length?(v=a.parent(),a.remove(),m=k?k.length:0,v.contents().size()>m?(l=v.contents().eq(-1-m),l=c(l,b,e,h,k)):(b=v.prev(),m=b.contents().eq(-1)[0],
|
|
"undefined"!=typeof m&&(q=d(g(m),h),f(m,q),k&&b.append(k),v.remove(),l=!0))):(q=d(q.slice(0,C+1).join(v),h),l=!0,f(m,q));return l}function d(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 e(a){return{width:a.innerWidth(),height:a.innerHeight()}}function f(a,b){a.innerText?a.innerText=b:a.nodeValue?a.nodeValue=b:a.textContent&&(a.textContent=b)}function g(a){return a.innerText?a.innerText:
|
|
a.nodeValue?a.nodeValue:a.textContent?a.textContent:""}function h(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 k(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||k(!0,'No element found for "'+
|
|
this.selector+'".'),this;if(1<this.length)return this.each(function(){a(this).dotdotdot(c)});var d=this;d.data("dotdotdot")&&d.trigger("destroy.dot");d.data("dotdotdot-style",d.attr("style"));d.css("word-wrap","break-word");d.bind_events=function(){return d.bind("update.dot",function(c,e){c.preventDefault();c.stopPropagation();var h=g,k;if("number"==typeof g.height)k=g.height;else{k=d.innerHeight();for(var l=["paddingTop","paddingBottom"],n=0,q=l.length;q>n;n++){var B=parseInt(d.css(l[n]),10);isNaN(B)&&
|
|
(B=0);k-=B}}h.maxHeight=k;g.maxHeight+=g.tolerance;"undefined"!=typeof e&&(("string"==typeof e||e instanceof HTMLElement)&&(e=a("<div />").append(e).contents()),e instanceof a&&(f=e));w=d.wrapInner('<div class="dotdotdot" />').children();w.empty().append(f.clone(!0)).css({height:"auto",width:"auto",border:"none",padding:0,margin:0});h=l=!1;m.afterElement&&(l=m.afterElement.clone(!0),m.afterElement.remove());if(w.innerHeight()>g.maxHeight)if("children"==g.wrap){h=w;k=g;n=h.children();q=!1;h.empty();
|
|
for(var B=0,A=n.length;A>B;B++){var r=n.eq(B);if(h.append(r),l&&h.append(l),h.innerHeight()>k.maxHeight){r.remove();q=!0;break}l&&l.detach()}h=q}else h=b(w,d,w,g,l);return w.replaceWith(w.contents()),w=null,a.isFunction(g.callback)&&g.callback.call(d[0],h,f),m.isTruncated=h,h}).bind("isTruncated.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),"function"==typeof b&&b.call(d[0],m.isTruncated),m.isTruncated}).bind("originalContent.dot",function(a,b){return a.preventDefault(),a.stopPropagation(),
|
|
"function"==typeof b&&b.call(d[0],f),f}).bind("destroy.dot",function(a){a.preventDefault();a.stopPropagation();d.unwatch().unbind_events().empty().append(f).attr("style",d.data("dotdotdot-style")).data("dotdotdot",!1)}),d};d.unbind_events=function(){return d.unbind(".dot"),d};d.watch=function(){if(d.unwatch(),"window"==g.watch){var b=a(window),c=b.width(),f=b.height();b.bind("resize.dot"+m.dotId,function(){c==b.width()&&f==b.height()&&g.windowResizeFix||(c=b.width(),f=b.height(),B&&clearInterval(B),
|
|
B=setTimeout(function(){d.trigger("update.dot")},10))})}else q=e(d),B=setInterval(function(){var a=e(d);(q.width!=a.width||q.height!=a.height)&&(d.trigger("update.dot"),q=e(d))},100);return d};d.unwatch=function(){return a(window).unbind("resize.dot"+m.dotId),B&&clearInterval(B),d};var f=d.contents(),g=a.extend(!0,{},a.fn.dotdotdot.defaults,c),m={},q={},B=null,w=null;return g.lastCharacter.remove instanceof Array||(g.lastCharacter.remove=a.fn.dotdotdot.defaultArrays.lastCharacter.remove),g.lastCharacter.noEllipsis instanceof
|
|
Array||(g.lastCharacter.noEllipsis=a.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),m.afterElement=h(g.after,d),m.isTruncated=!1,m.dotId=l++,d.data("dotdotdot",!0).bind_events().trigger("update.dot"),g.watch&&d.watch(),d};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 l=
|
|
1,m=a.fn.html;a.fn.html=function(a){return"undefined"!=typeof a?this.data("dotdotdot")&&"function"!=typeof a?this.trigger("update",[a]):m.call(this,a):m.call(this)};var q=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 q.call(this,b)}return q.call(this)}}}(jQuery);(function(a){if(!a.support.cors&&a.ajaxTransport&&window.XDomainRequest){var b=/^https?:\/\//i,c=/^get|post$/i,d=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,q=(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"===q||e.test(m.contentType))k.html=m.responseText;else if("json"===q||"text"!==q&&f.test(m.contentType))try{k.json=a.parseJSON(m.responseText)}catch(l){d=500,h="parseerror"}else if("xml"===q||"text"!==q&&g.test(m.contentType)){var n=new ActiveXObject("Microsoft.XMLDOM");n.async=!1;try{n.loadXML(m.responseText)}catch(u){n=void 0}if(!n||!n.documentElement||
|
|
n.getElementsByTagName("parsererror").length)throw"Invalid XML: "+m.responseText;k.xml=n}}catch(G){throw G;}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=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){B(a);h(this,a)}function g(a){a=u(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&&H.updateOffset(a);(h||b)&&(a.minute(e),a.hour(f))}function q(a){return"[object Array]"===Object.prototype.toString.call(a)}function n(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&&s(a[d])!==s(b[d]))&&g++;return g+f}function t(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=fb[a]||ma[b]||b}return a}function u(a){var b,c,d={};for(c in a)a.hasOwnProperty(c)&&
|
|
(b=t(c),b&&(d[b]=a[c]));return d}function z(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12;d="month"}H[b]=function(e,f){var g,h,k=H.fn._lang[b],l=[];if("number"==typeof e&&(f=e,e=a),h=function(a){a=H().utc().set(d,a);return k.call(H.fn._lang,a,e||"")},null!=f)return h(f);for(g=0;c>g;g++)l.push(h(g));return l}}function s(a){a=+a;var b=0;return 0!==a&&isFinite(a)&&(b=0<=a?Math.floor(a):Math.ceil(a)),b}function A(a){return 0===a%4&&0!==a%100||0===a%400}function B(a){var b;
|
|
a._a&&-2===a._pf.overflow&&(b=0>a._a[ka]||11<a._a[ka]?ka:1>a._a[ga]||a._a[ga]>(new Date(Date.UTC(a._a[fa],a._a[ka]+1,0))).getUTCDate()?ga:0>a._a[ba]||23<a._a[ba]?ba:0>a._a[na]||59<a._a[na]?na:0>a._a[sa]||59<a._a[sa]?sa:0>a._a[qa]||999<a._a[qa]?qa:-1,a._pf._overflowDayOfYear&&(fa>b||b>ga)&&(b=ga),a._pf.overflow=b)}function w(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 v(a){return a?a.toLowerCase().replace("_","-"):a}function C(a,b){return b._isUTC?H(a).zone(b._offset||0):H(a).local()}function G(a){var b,c,d,e,f=0,g=function(a){if(!oa[a]&&Ma)try{require("./lang/"+a)}catch(b){}return oa[a]};if(!a)return H.fn._lang;if(!q(a)){if(c=g(a))return c;a=[a]}for(;f<a.length;){e=v(a[f]).split("-");b=e.length;for(d=(d=v(a[f+1]))?d.split("-"):null;0<b;){if(c=g(e.slice(0,
|
|
b).join("-")))return c;if(d&&d.length>=b&&n(e,d,!0)>=b-1)break;b--}f++}return H.fn._lang}function I(a){var b,c,d=a.match(Oa);b=0;for(c=d.length;c>b;b++)d[b]=ha[d[b]]?ha[d[b]]:d[b].match(/\[[\s\S]/)?d[b].replace(/^\[|\]$/g,""):d[b].replace(/\\/g,"");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 E(a,b){return a.isValid()?(b=K(b,a.lang()),ia[b]||(ia[b]=I(b)),ia[b](a)):a.lang().invalidDate()}function K(a,b){function c(a){return b.longDateFormat(a)||
|
|
a}var d=5;for(ra.lastIndex=0;0<=d&&ra.test(a);)a=a.replace(ra,c),ra.lastIndex=0,d-=1;return a}function D(a,b){var c=b._strict;switch(a){case "DDDD":return Ua;case "YYYY":case "GGGG":case "gggg":return c?ca:Qa;case "Y":case "G":case "g":return Ca;case "YYYYYY":case "YYYYY":case "GGGGG":case "ggggg":return c?Ba:Ra;case "S":if(c)return Ta;case "SS":if(c)return Aa;case "SSS":if(c)return Ua;case "DDD":return ya;case "MMM":case "MMMM":case "dd":case "ddd":case "dddd":return cb;case "a":case "A":return G(b._l)._meridiemParse;
|
|
case "X":return Sa;case "Z":case "ZZ":return za;case "T":return db;case "SSSS":return bb;case "MM":case "DD":case "YY":case "GG":case "gg":case "HH":case "hh":case "mm":case "ss":case "ww":case "WW":return c?Aa: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=M(a.replace("\\","")).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return new c(d)}}function F(a){a=(a||"").match(za)||[];a=((a[a.length-1]||[])+"").match(xa)||
|
|
["-",0,0];var b=+(60*a[1])+s(a[2]);return"+"===a[0]?-b:b}function P(a){var b,c,d,e,f,g,h,k,l,n=[];if(!a._d){c=r(a);a._w&&null==a._a[ga]&&null==a._a[ka]&&(e=function(b){var c=parseInt(b,10);return b?3>b.length?68<c?1900+c:2E3+c:c:null==a._a[fa]?H().weekYear():a._a[fa]},f=a._w,null!=f.GG||null!=f.W||null!=f.E?g=W(e(f.GG),f.W||1,f.E,4,1):(h=G(a._l),k=null!=f.d?N(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=W(e(f.gg),l,k,h._week.doy,h._week.dow)),
|
|
a._a[fa]=g.year,a._dayOfYear=g.dayOfYear);a._dayOfYear&&(d=null==a._a[fa]?c[fa]:a._a[fa],a._dayOfYear>(A(d)?366:365)&&(a._pf._overflowDayOfYear=!0),b=J(d,0,a._dayOfYear),a._a[ka]=b.getUTCMonth(),a._a[ga]=b.getUTCDate());for(b=0;3>b&&null==a._a[b];++b)a._a[b]=n[b]=c[b];for(;7>b;b++)a._a[b]=n[b]=null==a._a[b]?2===b?1:0:a._a[b];n[ba]+=s((a._tzm||0)/60);n[na]+=s((a._tzm||0)%60);a._d=(a._useUTC?J:L).apply(null,n)}}function r(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:
|
|
[b.getFullYear(),b.getMonth(),b.getDate()]}function R(a){a._a=[];a._pf.empty=!0;var b,c,d,e,f;b=G(a._l);var g=""+a._i,h=g.length,k=0;d=K(a._f,b).match(Oa)||[];for(b=0;b<d.length;b++)if(e=d[b],(c=(g.match(D(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),ha[e]){c?a._pf.empty=!1:a._pf.unusedTokens.push(e);var l=a,n=void 0,m=l._a;switch(e){case "M":case "MM":null!=c&&(m[ka]=s(c)-1);break;case "MMM":case "MMMM":n=G(l._l).monthsParse(c);
|
|
null!=n?m[ka]=n:l._pf.invalidMonth=c;break;case "D":case "DD":null!=c&&(m[ga]=s(c));break;case "DDD":case "DDDD":null!=c&&(l._dayOfYear=s(c));break;case "YY":m[fa]=s(c)+(68<s(c)?1900:2E3);break;case "YYYY":case "YYYYY":case "YYYYYY":m[fa]=s(c);break;case "a":case "A":l._isPm=G(l._l).isPM(c);break;case "H":case "HH":case "h":case "hh":m[ba]=s(c);break;case "m":case "mm":m[na]=s(c);break;case "s":case "ss":m[sa]=s(c);break;case "S":case "SS":case "SSS":case "SSSS":m[qa]=s(1E3*("0."+c));break;case "X":l._d=
|
|
new Date(1E3*parseFloat(c));break;case "Z":case "ZZ":l._useUTC=!0;l._tzm=F(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[ba]&&(a._a[ba]+=12);!1===a._isPm&&12===a._a[ba]&&(a._a[ba]=0);P(a);B(a)}function M(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
|
|
function(a,b,c,d,e){return b||c||d||e})}function L(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 J(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function N(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 T(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function O(a,b,c){var d;b=c-b;c-=a.day();return c>b&&(c-=7),b-7>c&&(c+=7),d=H(a).add("d",
|
|
c),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function W(a,b,c,d,e){var f,g,h=J(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:(A(a-1)?366:365)+g}}function Z(c){var d=c._i,e=c._f;if(null===d)c=H.invalid({nullInput:!0});else{"string"==typeof d&&(c._i=d=G().preparse(d));if(H.isMoment(d)){c=d;var g,k={};for(g in c)c.hasOwnProperty(g)&&$a.hasOwnProperty(g)&&(k[g]=c[g]);c=k;c._d=new Date(+d._d)}else if(e)if(q(e)){var l=c,n,m;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],R(k),w(k)&&(g+=k._pf.charsLeftOver,g+=10*k._pf.unusedTokens.length,k._pf.score=g,(null==m||m>g)&&(m=g,n=k));h(l,n||k)}}else R(c);else if(k=c,n=k._i,m=Xa.exec(n),n===a)k._d=new Date;else if(m)k._d=new Date(+m[1]);else if("string"==typeof n)if(l=k._i,d=eb.exec(l)){k._pf.iso=!0;n=0;for(m=Da.length;m>n;n++)if(Da[n][1].exec(l)){k._f=Da[n][0]+(d[6]||" ");break}n=0;for(m=Ea.length;m>
|
|
n;n++)if(Ea[n][1].exec(l)){k._f+=Ea[n][0];break}l.match(za)&&(k._f+="Z");R(k)}else k._d=new Date(l);else q(n)?(k._a=n.slice(0),P(k)):"[object Date]"===Object.prototype.toString.call(n)||n instanceof Date?k._d=new Date(+n):"object"==typeof n?k._d||(l=u(k._i),k._a=[l.year,l.month,l.day,l.hour,l.minute,l.second,l.millisecond],P(k)):k._d=new Date(n);c=new f(c)}return c}function X(a,b){H.fn[a]=H.fn[a+"s"]=function(a){var c=this._isUTC?"UTC":"";return null!=a?(this._d["set"+c+b](a),H.updateOffset(this),
|
|
this):this._d["get"+c+b]()}}function aa(a){H.duration.fn[a]=function(){return this._data[a]}}function U(a,b){H.duration.fn["as"+a]=function(){return+this/b}}function Y(a){var b=!1,c=H;"undefined"==typeof ender&&(a?(V.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(V.moment,c)):V.moment=H)}for(var H,S,V=this,ea=Math.round,fa=0,ka=1,ga=2,ba=3,na=4,
|
|
sa=5,qa=6,oa={},$a={_isAMomentObject:null,_i:null,_f:null,_l:null,_strict:null,_isUTC:null,_offset:null,_pf:null,_lang:null},Ma="undefined"!=typeof module&&module.exports&&"undefined"!=typeof require,Xa=/^\/?Date\((\-?\d+)/i,ab=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Na=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Oa=/(\[[^\[]*\])|(\\)?(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,
|
|
ra=/(\[[^\[]*\])|(\\)?(LT|LL?L?L?|l{1,4})/g,Pa=/\d\d?/,ya=/\d{1,3}/,Qa=/\d{1,4}/,Ra=/[+\-]?\d{1,6}/,bb=/\d+/,cb=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,za=/Z|[\+\-]\d\d:?\d\d/gi,db=/T/i,Sa=/[\+\-]?\d+(\.\d{1,3})?/,Ta=/\d/,Aa=/\d\d/,Ua=/\d{3}/,ca=/\d{4}/,Ba=/[+-]?\d{6}/,Ca=/[+-]?\d+/,eb=/^\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)?)?$/,
|
|
Da=[["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}/]],Ea=[["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/]],xa=/([\+\-]|\d\d)/gi,Fa=["Date","Hours","Minutes","Seconds","Milliseconds"],Ga={Milliseconds:1,Seconds:1E3,Minutes:6E4,Hours:36E5,Days:864E5,Months:2592E6,Years:31536E6},fb={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"},ma={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},ia={},Ha="DDD w W M D d".split(" "),Ia="MDHhmswW".split(""),ha={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 s(this.milliseconds()/100)},SS:function(){return l(s(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(s(a/60),2)+":"+l(s(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,
|
|
b="-"),b+l(s(a/60),2)+l(s(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},X:function(){return this.unix()},Q:function(){return this.quarter()}},Ja=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];Ha.length;)S=Ha.pop(),ha[S+"o"]=d(ha[S],S);for(;Ia.length;)S=Ia.pop(),ha[S+S]=c(ha[S],2);ha.DDDD=c(ha.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=H.utc([2E3,b]),d="^"+this.months(c,"")+"|^"+this.monthsShort(c,""),this._monthsParse[b]=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=H([2E3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,
|
|
""),this._weekdaysParse[b]=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 O(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",
|
|
invalidDate:function(){return this._invalidDate}});H=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(),Z(g)};H.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(),Z(g).utc()};H.unix=function(a){return H(1E3*a)};H.duration=function(a,b){var c,d,e,f=a,h=null;return H.isDuration(a)?f={ms:a._milliseconds,
|
|
d:a._days,M:a._months}:"number"==typeof a?(f={},b?f[b]=a:f.milliseconds=a):(h=ab.exec(a))?(c="-"===h[1]?-1:1,f={y:0,d:s(h[ga])*c,h:s(h[ba])*c,m:s(h[na])*c,s:s(h[sa])*c,ms:s(h[qa])*c}):(h=Na.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),H.isDuration(a)&&a.hasOwnProperty("_lang")&&(d._lang=a._lang),d};H.version="2.5.1";H.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";
|
|
H.updateOffset=function(){};H.lang=function(a,b){var c,d;a?(b?(d=v(a),b.abbr=d,oa[d]||(oa[d]=new e),oa[d].set(b)):null===b?(delete oa[a],a="en"):oa[a]||G(a),d=(c=H.duration.fn._lang=H.fn._lang=G(a),c._abbr)):d=H.fn._lang._abbr;return d};H.langData=function(a){return a&&a._lang&&a._lang._abbr&&(a=a._lang._abbr),G(a)};H.isMoment=function(a){return a instanceof f||null!=a&&a.hasOwnProperty("_isAMomentObject")};H.isDuration=function(a){return a instanceof g};for(S=Ja.length-1;0<=S;--S)z(Ja[S]);H.normalizeUnits=
|
|
function(a){return t(a)};H.invalid=function(a){var b=H.utc(0/0);return null!=a?h(b._pf,a):b._pf.userInvalidated=!0,b};H.parseZone=function(a){return H(a).parseZone()};h(H.fn=f.prototype,{clone:function(){return H(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=
|
|
H(this).utc();return 0<a.year()&&9999>=a.year()?E(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):E(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 w(this)},isDSTShifted:function(){return this._a?this.isValid()&&0<n(this._a,(this._isUTC?H.utc(this._a):H(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=E(this,a||H.defaultFormat);return this.lang().postformat(a)},add:function(a,b){var c;return c="string"==typeof a?H.duration(+b,a):H.duration(a,b),m(this,c,1),this},subtract:function(a,b){var c;return c="string"==typeof a?H.duration(+b,a):H.duration(a,b),m(this,c,-1),this},diff:function(a,b,c){var d,e;a=C(a,this);var f=6E4*(this.zone()-a.zone());return b=t(b),"year"===b||"month"===b?(d=
|
|
432E5*(this.daysInMonth()+a.daysInMonth()),e=12*(this.year()-a.year())+(this.month()-a.month()),e+=(this-H(this).startOf("month")-(a-H(a).startOf("month")))/d,e-=6E4*(this.zone()-H(this).startOf("month").zone()-(a.zone()-H(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 H.duration(this.diff(a)).lang(this.lang()._abbr).humanize(!b)},fromNow:function(a){return this.from(H(),
|
|
a)},calendar:function(){var a=C(H(),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 A(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=N(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())),H.updateOffset(this),this):this._d["get"+c+"Month"]()},startOf:function(a){switch(a=t(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=t(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)>+H(a).startOf(b)},isBefore:function(a,b){return b="undefined"!=typeof b?b:"millisecond",+this.clone().startOf(b)<+H(a).startOf(b)},isSame:function(a,b){return b=b||"ms",+this.clone().startOf(b)===+C(a,this).startOf(b)},min:function(a){return a=H.apply(null,
|
|
arguments),this>a?this:a},max:function(a){return a=H.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=F(a)),16>Math.abs(a)&&(a*=60),this._offset=a,this._isUTC=!0,b!==a&&m(this,H.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?H(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=ea((H(this).startOf("day")-H(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=O(this,this.lang()._week.dow,this.lang()._week.doy).year;return null==
|
|
a?b:this.add("y",a-b)},isoWeekYear:function(a){var b=O(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=O(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=t(a),this[a]()},set:function(a,
|
|
b){return a=t(a),"function"==typeof this[a]&&this[a](b),this},lang:function(b){return b===a?this._lang:(this._lang=G(b),this)}});for(S=0;S<Fa.length;S++)X(Fa[S].toLowerCase().replace(/s$/,""),Fa[S]);X("year","FullYear");H.fn.days=H.fn.day;H.fn.months=H.fn.month;H.fn.weeks=H.fn.week;H.fn.isoWeeks=H.fn.isoWeek;H.fn.toJSON=H.fn.toISOString;h(H.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+2592E6*(this._months%12)+31536E6*s(this._months/12)},humanize:function(a){var b=+this,c;c=!a;var d=this.lang(),e=ea(Math.abs(b)/1E3),f=ea(e/60),g=ea(f/60),h=ea(g/24),k=ea(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",ea(h/30)]||1===k&&["y"]||["yy",k];c=(e[2]=c,e[3]=0<b,e[4]=d,T.apply({},e));return a&&(c=this.lang().pastFuture(b,c)),this.lang().postformat(c)},add:function(a,b){var c=H.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=H.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=
|
|
t(a),this[a.toLowerCase()+"s"]()},as:function(a){return a=t(a),this["as"+a.charAt(0).toUpperCase()+a.slice(1)+"s"]()},lang:H.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(S in Ga)Ga.hasOwnProperty(S)&&
|
|
(U(S,Ga[S]),aa(S.toLowerCase()));U("Weeks",6048E5);H.duration.fn.asMonths=function(){return(+this-31536E6*this.years())/2592E6+12*this.years()};H.lang("en",{ordinal:function(a){var b=a%10,b=1===s(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+b}});Ma?(module.exports=H,Y(!0)):"function"==typeof define&&define.amd?define("moment",function(b,c,d){return d.config&&d.config()&&!0!==d.config().noGlobal&&Y(d.config().noGlobal===a),H}):Y()}).call(this);(function(){function a(a){return(10>a?"0":"")+a}function b(a){var b=++z+"";return a?a+b:b}function c(c,e){function l(a,b){var c=u.offset(),d=/^touch/.test(a.type),h=c.left+s,m=c.top+s,q=(d?a.originalEvent.touches[0]:a).pageX-h,r=(d?a.originalEvent.touches[0]:a).pageY-m,c=Math.sqrt(q*q+r*r),B=!1;if(!b||!(c<A-w||c>A+w)){a.preventDefault();var v=setTimeout(function(){g.addClass("clockpicker-moving")},200);k&&u.append(J.canvas);J.setHand(q,r,!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-h;a=(b?a.originalEvent.touches[0]:a).pageY-m;if(B||c!==q||a!==r)B=!0,J.setHand(c,a,!1,!0)});f.off(t).one(t,function(a){a.preventDefault();var c=/^touch/.test(a.type),d=(c?a.originalEvent.changedTouches[0]:a).pageX-h;a=(c?a.originalEvent.changedTouches[0]:a).pageY-m;(b||B)&&d===q&&a===r&&J.setHand(d,a);"hours"===J.currentView?J.toggleView("minutes",C/2):e.autoclose&&(J.minutesView.addClass("clockpicker-dial-out"),setTimeout(function(){J.done()},C/2));u.prepend(W);
|
|
clearTimeout(v);g.removeClass("clockpicker-moving");f.off(n)})}}var m=d(G),u=m.find(".clockpicker-plate"),z=m.find(".clockpicker-hours"),r=m.find(".clockpicker-minutes"),R="INPUT"===c.prop("tagName"),M=R?c:c.find("input"),L=c.find(".input-group-addon"),J=this;this.id=b("cp");this.element=c;this.options=e;this.isShown=this.isAppended=!1;this.currentView="hours";this.isInput=R;this.input=M;this.addon=L;this.popover=m;this.plate=u;this.hoursView=z;this.minutesView=r;this.spanHours=m.find(".clockpicker-span-hours");
|
|
this.spanMinutes=m.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(m);"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");m.addClass(e.placement);m.addClass("clockpicker-align-"+e.align);this.spanHours.click(d.proxy(this.toggleView,
|
|
this,"hours"));this.spanMinutes.click(d.proxy(this.toggleView,this,"minutes"));M.on("focus.clockpicker click.clockpicker",d.proxy(this.show,this));L.on("click.clockpicker",d.proxy(this.toggle,this));for(var R=d('<div class="clockpicker-tick"></div>'),N,M=0;24>M;M+=1){L=R.clone();N=M/6*Math.PI;var T=0<M&&13>M,O=T?B:A;L.css({left:s+Math.sin(N)*O-w,top:s-Math.cos(N)*O-w});T&&L.css("font-size","120%");L.html(0===M?"00":M);z.append(L);L.on(q,l)}for(M=0;60>M;M+=5)L=R.clone(),N=M/30*Math.PI,L.css({left:s+
|
|
Math.sin(N)*A-w,top:s-Math.cos(N)*A-w}),L.css("font-size","120%"),L.html(a(M)),r.append(L),L.on(q,l);u.on(q,function(a){0===d(a.target).closest(".clockpicker-tick").length&&l(a,!0)});if(k){var W=m.find(".clockpicker-canvas"),m=document.createElementNS(h,"svg");m.setAttribute("class","clockpicker-svg");m.setAttribute("width",v);m.setAttribute("height",v);z=document.createElementNS(h,"g");z.setAttribute("transform","translate("+s+","+s+")");r=document.createElementNS(h,"circle");r.setAttribute("class",
|
|
"clockpicker-canvas-bearing");r.setAttribute("cx",0);r.setAttribute("cy",0);r.setAttribute("r",2);R=document.createElementNS(h,"line");R.setAttribute("x1",0);R.setAttribute("y1",0);M=document.createElementNS(h,"circle");M.setAttribute("class","clockpicker-canvas-bg");M.setAttribute("r",w);L=document.createElementNS(h,"circle");L.setAttribute("class","clockpicker-canvas-fg");L.setAttribute("r",3.5);z.appendChild(R);z.appendChild(M);z.appendChild(L);z.appendChild(r);m.appendChild(z);W.append(m);this.hand=
|
|
R;this.bg=M;this.fg=L;this.bearing=r;this.g=z;this.canvas=W}}var d=window.jQuery,e=d(window),f=d(document),g,h="http://www.w3.org/2000/svg",k="SVGAngle"in window&&function(){var a,b=document.createElement("div");b.innerHTML="<svg/>";a=(b.firstChild&&b.firstChild.namespaceURI)==h;b.innerHTML="";return a}(),l=function(){var a=document.createElement("div").style;return"transition"in a||"WebkitTransition"in a||"MozTransition"in a||"msTransition"in a||"OTransition"in a}(),m="ontouchstart"in window,q="mousedown"+
|
|
(m?" touchstart":""),n="mousemove.clockpicker"+(m?" touchmove.clockpicker":""),t="mouseup.clockpicker"+(m?" touchend.clockpicker":""),u=navigator.vibrate?"vibrate":navigator.webkitVibrate?"webkitVibrate":null,z=0,s=100,A=80,B=54,w=13,v=2*s,C=l?350:1,G='<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>';
|
|
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")},C)};c.prototype.resetClock=function(a){var b=this.currentView,c=this[b],d="hours"===b,b=c*(Math.PI/(d?6:30)),c=d&&0<c&&13>c?B:A,e=Math.sin(b)*c,f=-Math.cos(b)*c,g=this;k&&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),h="hours"===this.currentView,l=Math.PI/(h||e?6:30);b=Math.sqrt(b*b+c*c);b=(c=h&&b<(A+B)/2)?B:A;var n;0>g&&(g=2*Math.PI+g);n=Math.round(g/l);g=n*l;h?(12===n&&(n=0),n=c?0===n?12:n:0===n?0:n+12):(e&&(n*=5),60===n&&(n=0));this[this.currentView]!==n&&u&&this.options.vibrate&&!this.vibrateTimer&&(navigator[u](10),this.vibrateTimer=setTimeout(d.proxy(function(){this.vibrateTimer=null},this),100));this[this.currentView]=
|
|
n;this[h?"spanHours":"spanMinutes"].html(a(n));k?(f||!h&&n%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[h?"hoursView":"minutesView"].find(".clockpicker-tick").each(function(){var a=d(this);a.toggleClass("active",n===+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 n=[];l&&(n.push(l),l=null);g.cache||n.push("_="+(new Date).getTime());g.jsonp&&(n.push("callback="+g.jsonp),n.push("jsonp="+g.jsonp));n=n.join("&");
|
|
1<n.length&&(f=-1<f.indexOf("?")?f+("&"+n):f+("?"+n));if(g.jsonp){var n=document.getElementsByTagName("head")[0],m=document.createElement("script");m.type="text/javascript";m.src=f;n.appendChild(m);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,n,m,q=0;do k=d.charCodeAt(q++),g=d.charCodeAt(q++),h=d.charCodeAt(q++),l=k>>2,k=(k&3)<<4|g>>4,n=(g&15)<<2|h>>6,m=h&63,isNaN(g)?n=m=64:isNaN(h)&&(m=64),f+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(l)+
|
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(k)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m);while(q<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||{};E.extend(v,
|
|
a);delete v.fixLng;"string"==typeof v.ns&&(v.ns={namespaces:[v.ns],defaultNs:v.ns});"string"==typeof v.fallbackNS&&(v.fallbackNS=[v.fallbackNS]);if("string"==typeof v.fallbackLng||"boolean"==typeof v.fallbackLng)v.fallbackLng=[v.fallbackLng];v.interpolationPrefixEscaped=E.regexEscape(v.interpolationPrefix);v.interpolationSuffixEscaped=E.regexEscape(v.interpolationSuffix);v.lng||(v.lng=E.detectLanguage());v.lng?v.useCookie&&E.cookie.create(v.cookieName,v.lng,v.cookieExpirationTime,v.cookieDomain):
|
|
(v.lng=v.fallbackLng[0],v.useCookie&&E.cookie.remove(v.cookieName));B=E.toLanguages(v.lng);s=B[0];E.log("currentLng set to: "+s);var c=l;a.fixLng&&(c=function(a,b){b=b||{};b.lng=b.lng||c.lng;return l(a,b)},c.lng=s);D.setCurrentLng(s);t&&v.setJqueryExt&&f();var d;t&&t.Deferred&&(d=t.Deferred());if(v.resStore)z=v.resStore,w=!0,b&&b(c),d&&d.resolve(c);else{var e=E.toLanguages(v.lng);"string"===typeof v.preload&&(v.preload=[v.preload]);for(var g=0,h=v.preload.length;g<h;g++)for(var k=E.toLanguages(v.preload[g]),
|
|
n=0,m=k.length;n<m;n++)0>e.indexOf(k[n])&&e.push(k[n]);u.sync.load(e,v,function(a,e){z=e;w=!0;b&&b(c);d&&d.resolve(c)})}if(d)return d.promise()}function e(a,b){var c={dynamicLoad:v.dynamicLoad,resGetPath:v.resGetPath,getAsync:v.getAsync,customLoad:v.customLoad,ns:{namespaces:a,defaultNs:""}},d=E.toLanguages(v.lng);"string"===typeof v.preload&&(v.preload=[v.preload]);for(var e=0,f=v.preload.length;e<f;e++)for(var g=E.toLanguages(v.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=z[d[e]])for(var k=0,n=a.length;k<n;k++)h[a[k]]||(g=!0);else g=!0;g&&l.push(d[e])}l.length?u.sync._fetch(l,c,function(c,d){var e=a.length*l.length;E.each(a,function(a,c){0>v.ns.namespaces.indexOf(c)&&v.ns.namespaces.push(c);E.each(l,function(a,f){z[f]=z[f]||{};z[f][c]=d[f][c];e--;0===e&&b&&(v.useLocalStorage&&u.sync._storeLocal(z),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=v.defaultValueFromContent?t.extend({defaultValue:b.html()},d):d,b.html(t.t(c,d));else if("text"===e)d=v.defaultValueFromContent?t.extend({defaultValue:b.text()},d):d,b.text(t.t(c,d));else if("prepend"===e)d=v.defaultValueFromContent?t.extend({defaultValue:b.html()},d):d,b.prepend(t.t(c,d));else if("append"===e)d=v.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=v.defaultValueFromContent?t.extend({defaultValue:b.data(f)},d):d;c=t.t(c,d);b.data(f,c);b.attr(e,c)}else d=v.defaultValueFromContent?t.extend({defaultValue:b.attr(e)},d):d,b.attr(e,t.t(c,d))}}function b(c,d){var e=c.attr(v.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!==v.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===v.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("["+v.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||v.interpolationPrefix))return a;var e=d.interpolationPrefix?E.regexEscape(d.interpolationPrefix):v.interpolationPrefixEscaped,f=d.interpolationSuffix?E.regexEscape(d.interpolationSuffix):
|
|
v.interpolationSuffixEscaped,h="HTML"+f;E.each(b,function(b,k){var l=c?c+v.keyseparator+b:b;"object"===typeof k&&null!==k?a=g(a,k,l,d):d.escapeInterpolation||v.escapeInterpolation?(a=a.replace(RegExp([e,l,h].join(""),"g"),k),a=a.replace(RegExp([e,l,f].join(""),"g"),E.escape(k))):a=a.replace(RegExp([e,l,f].join(""),"g"),k)});return a}function h(a,b){var c=E.extend({},b);for(delete c.postProcess;-1!=a.indexOf(v.reusePrefix);){A++;if(A>v.maxRecursion)break;var d=a.lastIndexOf(v.reusePrefix),e=a.indexOf(v.reuseSuffix,
|
|
d)+v.reuseSuffix.length,d=a.substring(d,e),e=d.replace(v.reusePrefix,"").replace(v.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=E.extend(c,JSON.parse(e.substring(g,h))),e=e.substring(0,f)}catch(k){}}}e=q(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=n(a,b);return void 0!==d||d===c}function l(a,b){b=b||{};if(!w)return a||"";A=0;return q.apply(null,
|
|
arguments)}function m(){for(var a=[],b=1;b<arguments.length;b++)a.push(arguments[b]);return{postProcess:"sprintf",sprintf:a}}function q(a,b){b&&"object"!==typeof b?"sprintf"===v.shortcutFunction?b=m.apply(null,arguments):"defaultValue"===v.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=n(c,b),f=b.lng?E.toLanguages(b.lng):
|
|
B,l=b.ns||v.ns.defaultNs,q;-1<c.indexOf(v.nsseparator)&&(q=c.split(v.nsseparator),l=q[0],c=q[1]);void 0===e&&v.sendMissing&&(b.lng?K.postMissing(f[0],l,c,d,f):K.postMissing(v.lng,l,c,d,f));f=b.postProcess||v.postProcess;void 0!==e&&f&&F[f]&&(e=F[f](e,c,b));q=d;-1<d.indexOf(v.nsseparator)&&(q=d.split(v.nsseparator),q=q[1]);q===c&&v.parseMissingKey&&(d=v.parseMissingKey(d));void 0===e&&(d=g(d,b),d=h(d,b),f&&F[f]&&(e=F[f](void 0!==b.defaultValue?b.defaultValue:c,c,b)));return void 0!==e?e:d}function n(a,
|
|
b){b=b||{};var c,d=void 0!==b.defaultValue?b.defaultValue:a,e=B;if(!z||"cimode"===e[0].toLowerCase())return d;if(b.lng&&(e=E.toLanguages(b.lng),!z[e[0]])){var f=v.getAsync;v.getAsync=!1;u.sync.load(e,v,function(a,b){E.extend(z,b);v.getAsync=f})}var k=b.ns||v.ns.defaultNs;-1<a.indexOf(v.nsseparator)&&(c=a.split(v.nsseparator),k=c[0],a=c[1]);if(b.context&&("string"==typeof b.context||"number"==typeof b.context)&&(c=E.extend({},b),delete c.context,c.defaultValue=v.contextNotFound,c=l(k+v.nsseparator+
|
|
a+"_"+b.context,c),c!=v.contextNotFound))return g(c,{context:b.context});if(void 0!==b.count&&"string"!=typeof b.count&&1!==b.count){c=E.extend({},b);delete c.count;c.defaultValue=v.pluralNotFound;var m=k+v.nsseparator+a+v.pluralSuffix,t=D.get(e[0],b.count);0<=t?m=m+"_"+t:1===t&&(m=k+v.nsseparator+a);c=l(m,c);if(c!=v.pluralNotFound)return g(c,{count:b.count,interpolationPrefix:b.interpolationPrefix,interpolationSuffix:b.interpolationSuffix})}var s;c=a.split(v.keyseparator);m=0;for(t=e.length;m<t&&
|
|
void 0===s;m++){for(var w=e[m],C=0,A=z[w]&&z[w][k];c[C];)A=A&&A[c[C]],C++;if(void 0!==A){s=Object.prototype.toString.apply(A);if("string"===typeof A)A=g(A,b),A=h(A,b);else if("[object Array]"===s&&!v.returnObjectTrees&&!b.returnObjectTrees)A=A.join("\n"),A=g(A,b),A=h(A,b);else if(null===A&&!0===v.fallbackOnNull)A=void 0;else if(null!==A)if(!v.returnObjectTrees&&!b.returnObjectTrees)v.objectTreeKeyHandler&&"function"==typeof v.objectTreeKeyHandler?A=v.objectTreeKeyHandler(a,A,w,k,b):(A="key '"+k+":"+
|
|
a+" ("+w+")' returned an object instead of string.",E.log(A));else if("[object Number]"!==s&&"[object Function]"!==s&&"[object RegExp]"!==s){var G="[object Array]"===s?[]:{};E.each(A,function(c){G[c]=q(k+v.nsseparator+a+v.keyseparator+c,b)});A=G}"string"===typeof A&&""===A.trim()&&!0===v.fallbackOnEmpty&&(A=void 0);s=A}}if(void 0===s&&!b.isFallbackLookup&&(!0===v.fallbackToDefaultNS||v.fallbackNS&&0<v.fallbackNS.length))if(b.isFallbackLookup=!0,v.fallbackNS.length)for(e=0,c=v.fallbackNS.length;e<
|
|
c;e++){if(s=n(v.fallbackNS[e]+v.nsseparator+a,b))if(m=-1<s.indexOf(v.nsseparator)?s.split(v.nsseparator)[1]:s,t=-1<d.indexOf(v.nsseparator)?d.split(v.nsseparator)[1]:d,m!==t)break}else s=n(a,b);return s}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 t=this.jQuery||this.Zepto,u={},z={},s,A=0,B=[],w=!1;"undefined"!==typeof module&&module.exports?module.exports=u:(t&&(t.i18n=t.i18n||u),this.i18n=this.i18n||u);var v={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:!0,postAsync:!0,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"},C={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},G={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)}},I={create:function(a,b,c,d){},read:function(a){return null},remove:function(a){}},E={extend:t?t.extend:a,each:t?t.each:b,ajax:t?t.ajax:"undefined"!==typeof document?c:function(){},cookie:"undefined"!==typeof document?G:I,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[v.detectLngQS]&&(a=b[v.detectLngQS])}!a&&"undefined"!==typeof document&&v.useCookie&&(b=E.cookie.read(v.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 C[a]}):a},log:function(a){v.debug&&"undefined"!==typeof console&&console.log(a)},toLanguages:function(a){var b=[];if("string"===typeof a&&-1<a.indexOf("-")){var c=a.split("-");a=v.lowerCaseLng?c[0].toLowerCase()+"-"+c[1].toLowerCase():c[0].toLowerCase()+"-"+c[1].toUpperCase();"unspecific"!==v.load&&b.push(a);"current"!==v.load&&b.push(c[0])}else b.push(a);for(a=0;a<v.fallbackLng.length;a++)-1===b.indexOf(v.fallbackLng[a])&&v.fallbackLng[a]&&b.push(v.fallbackLng[a]);return b},regexEscape:function(a){return a.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
|
|
"\\$&")}};E.applyReplacement=g;var K={load:function(a,b,c){b.useLocalStorage?K._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?K._fetch(f,b,function(a,b){E.extend(e,b);K._storeLocal(b);c(null,e)}):c(null,e)}):K._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;E.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("+")});E.ajax({url:h,success:function(a,b,d){E.log("loaded: "+
|
|
h);c(null,a)},error:function(a,b,d){E.log("failed loading: "+h);c(null,void 0)},dataType:"json",async:b.getAsync})}}else{var k=d.namespaces.length*a.length,l;E.each(d.namespaces,function(d,f){E.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):K._fetchOne(d,f,b,g)})})}},_fetchOne:function(a,b,c,d){var e=g(c.resGetPath,{lng:a,ns:b});E.ajax({url:e,success:function(a,b,c){E.log("loaded: "+e);
|
|
d(null,a)},error:function(a,b,c){b&&200==b||a&&a.status&&200==a.status?E.log("There is a typo in: "+e):b&&404==b||a&&a.status&&404==a.status?E.log("Does not exist: "+e):E.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"===v.sendMissingTo&&!1!==v.fallbackLng[0])for(a=0;a<v.fallbackLng.length;a++)h.push({lng:v.fallbackLng[a],url:g(v.resPostPath,{lng:v.fallbackLng[a],ns:b})});else if("current"===
|
|
v.sendMissingTo||"fallback"===v.sendMissingTo&&!1===v.fallbackLng[0])h.push({lng:a,url:g(v.resPostPath,{lng:a,ns:b})});else if("all"===v.sendMissingTo){a=0;for(var k=e.length;a<k;a++)h.push({lng:e[a],url:g(v.resPostPath,{lng:e[a],ns:b})})}e=0;for(a=h.length;e<a;e++){var l=h[e];E.ajax({url:l.url,type:v.sendType,data:f,success:function(a,e,f){E.log("posted missing key '"+c+"' to: "+l.url);a=c.split(".");e=0;for(f=z[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){E.log("failed posting missing key '"+c+"' to: "+l.url)},dataType:"json",async:v.postAsync})}}},D={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){D.rules[a]=b},setCurrentLng:function(a){if(!D.currentRule||D.currentRule.lng!==
|
|
a){var b=a.split("-");D.currentRule={lng:a,rule:D.rules[b[0]]}}},get:function(a,b){var c=a.split("-");if(c=D.currentRule&&D.currentRule.lng===a?D.currentRule.rule:D.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}},F={},G=function(a,b){F[a]=b},P=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,n;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 P('[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 P("[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):" ";n=l[6]-String(f).length;
|
|
if(l[6]){for(var m=[];0<n;m[--n]=k);k=m.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}();G("sprintf",function(a,b,c){return c.sprintf?"[object Array]"===Object.prototype.toString.apply(c.sprintf)?(b=c.sprintf,b.unshift(a),P.apply(null,b)):"object"===
|
|
typeof c.sprintf?P(a,c.sprintf):a:a});u.init=d;u.setLng=function(a,b,c){"function"===typeof b?(c=b,b={}):b||(b={});b.lng=a;return d(b,c)};u.preload=function(a,b){"string"===typeof a&&(a=[a]);for(var c=0,e=a.length;c<e;c++)0>v.preload.indexOf(a[c])&&v.preload.push(a[c]);return d(b)};u.addResourceBundle=function(a,b,c){"string"!==typeof b?(c=b,b=v.ns.defaultNs):0>v.ns.namespaces.indexOf(b)&&v.ns.namespaces.push(b);z[a]=z[a]||{};z[a][b]=z[a][b]||{};E.extend(z[a][b],c)};u.removeResourceBundle=function(a,
|
|
b){"string"!==typeof b&&(b=v.ns.defaultNs);z[a]=z[a]||{};z[a][b]={}};u.loadNamespace=function(a,b){e([a],b)};u.loadNamespaces=e;u.setDefaultNamespace=function(a){v.ns.defaultNs=a};u.t=l;u.translate=l;u.exists=k;u.detectLanguage=E.detectLanguage;u.pluralExtensions=D;u.sync=K;u.functions=E;u.lng=function(){return s};u.addPostProcessor=G;u.options=v})();(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,q,n;9===h.nodeType?(m=g.width(),q=g.height(),n={top:0,left:0}):h.setTimeout?(m=g.width(),q=g.height(),n={top:g.scrollTop(),left:g.scrollLeft()}):h.preventDefault?(e.at="left top",m=q=0,n={top:e.of.pageY,left:e.of.pageX}):
|
|
(m=g.outerWidth(),q=g.outerHeight(),n=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]?n.left+=m:"center"===e.at[0]&&(n.left+=m/2);"bottom"===e.at[1]?n.top+=q:"center"===e.at[1]&&
|
|
(n.top+=q/2);n.left+=l[0];n.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,B=c+g+(parseInt(a.curCSS(this,"marginRight",!0))||0),w=d+h+(parseInt(a.curCSS(this,"marginBottom",!0))||0),v=a.extend({},n),C;"right"===e.my[0]?v.left-=c:"center"===e.my[0]&&(v.left-=c/2);"bottom"===e.my[1]?v.top-=d:"center"===e.my[1]&&(v.top-=d/2);v.left=Math.round(v.left);v.top=Math.round(v.top);
|
|
C={left:v.left-g,top:v.top-h};a.each(["left","top"],function(b,g){a.ui.position[k[b]]&&a.ui.position[k[b]][g](v,{targetWidth:m,targetHeight:q,elemWidth:c,elemHeight:d,collisionPosition:C,collisionWidth:B,collisionHeight:w,offset:l,my:e.my,at:e.at})});a.fn.bgiframe&&b.bgiframe();b.offset(a.extend(v,{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 q=d.snapElements[m].left,n=q+d.snapElements[m].width,t=d.snapElements[m].top,u=t+d.snapElements[m].height;if(q-
|
|
f<g&&g<n+f&&t-f<k&&k<u+f||q-f<g&&g<n+f&&t-f<l&&l<u+f||q-f<h&&h<n+f&&t-f<k&&k<u+f||q-f<h&&h<n+f&&t-f<l&&l<u+f){if("inner"!=e.snapMode){var z=Math.abs(t-l)<=f,s=Math.abs(u-k)<=f,A=Math.abs(q-h)<=f,B=Math.abs(n-g)<=f;z&&(c.position.top=d._convertPositionTo("relative",{top:t-d.helperProportions.height,left:0}).top-d.margins.top);s&&(c.position.top=d._convertPositionTo("relative",{top:u,left:0}).top-d.margins.top);A&&(c.position.left=d._convertPositionTo("relative",{top:0,left:q-d.helperProportions.width}).left-
|
|
d.margins.left);B&&(c.position.left=d._convertPositionTo("relative",{top:0,left:n}).left-d.margins.left)}var w=z||s||A||B;"outer"!=e.snapMode&&(z=Math.abs(t-k)<=f,s=Math.abs(u-l)<=f,A=Math.abs(q-g)<=f,B=Math.abs(n-h)<=f,z&&(c.position.top=d._convertPositionTo("relative",{top:t,left:0}).top-d.margins.top),s&&(c.position.top=d._convertPositionTo("relative",{top:u-d.helperProportions.height,left:0}).top-d.margins.top),A&&(c.position.left=d._convertPositionTo("relative",{top:0,left:q}).left-d.margins.left),
|
|
B&&(c.position.left=d._convertPositionTo("relative",{top:0,left:n-d.helperProportions.width}).left-d.margins.left));!d.snapElements[m].snapping&&(z||s||A||B||w)&&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=z||s||A||B||w}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,q=this.position.top+this.size.height,
|
|
n=/sw|nw|w/.test(f),f=/nw|ne|n/.test(f);k&&n&&(a.left=m-b.minWidth);g&&n&&(a.left=m-b.maxWidth);l&&f&&(a.top=q-b.minHeight);h&&f&&(a.top=q-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:0.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,q=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+q>g&&c+q<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;alignValue=a-d;2*Math.abs(d)>=c&&(alignValue+=0<d?c:-c);return parseFloat(alignValue.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=100*((d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin()));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?100*((k-l)/(m-l)):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 q=this._newInst(a(b),
|
|
l);q.settings=a.extend({},c||{},d||{});"input"==e?this._connectDatepicker(b,q):l&&this._inlineDatepicker(b,q)},_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),q=this._getMinMaxDate(k,"min"),n=this._getMinMaxDate(k,"max");d(k.settings,l);null!==q&&
|
|
l.dateFormat!==b&&l.minDate===b&&(k.settings.minDate=this._formatDate(k,q));null!==n&&l.dateFormat!==b&&l.maxDate===b&&(k.settings.maxDate=this._formatDate(k,n));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,q=b.input?b.input.outerHeight():0,n=document.documentElement.clientWidth+a(document).scrollLeft(),t=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+q?a(document).scrollTop():0;c.left-=Math.min(c.left,
|
|
c.left+e>n&&n>e?Math.abs(c.left+e-n):0);c.top-=Math.min(c.top,c.top+l>t&&t>l?Math.abs(l+q):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,q=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,
|
|
n=(c?c.monthNames:null)||this._defaults.monthNames,t=c=-1,u=-1,z=-1,s=!1,A=function(b){(b=G+1<a.length&&a.charAt(G+1)==b)&&G++;return b},B=function(a){var c=A(a);a=RegExp("^\\d{1,"+("@"==a?14:"!"==a?20:"y"==a&&c?4:"o"==a?3:2)+"}");a=b.substring(C).match(a);if(!a)throw"Missing number at position "+C;C+=a[0].length;return parseInt(a[0],10)},w=function(a,c,d){a=A(a)?d:c;for(c=0;c<a.length;c++)if(b.substr(C,a[c].length).toLowerCase()==a[c].toLowerCase())return C+=a[c].length,c+1;throw"Unknown name at position "+
|
|
C;},v=function(){if(b.charAt(C)!=a.charAt(G))throw"Unexpected literal at position "+C;C++},C=0,G=0;G<a.length;G++)if(s)"'"!=a.charAt(G)||A("'")?v():s=!1;else switch(a.charAt(G)){case "d":u=B("d");break;case "D":w("D",e,m);break;case "o":z=B("o");break;case "m":t=B("m");break;case "M":t=w("M",q,n);break;case "y":c=B("y");break;case "@":var I=new Date(B("@"));c=I.getFullYear();t=I.getMonth()+1;u=I.getDate();break;case "!":I=new Date((B("!")-this._ticksTo1970)/1E4);c=I.getFullYear();t=I.getMonth()+1;
|
|
u=I.getDate();break;case "'":A("'")?v():s=!0;break;default:v()}-1==c?c=(new Date).getFullYear():100>c&&(c+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c<=d?0:-100));if(-1<z){t=1;u=z;do{d=this._getDaysInMonth(c,t-1);if(u<=d)break;t++;u-=d}while(1)}I=this._daylightSavingAdjust(new Date(c,t-1,u));if(I.getFullYear()!=c||I.getMonth()+1!=t||I.getDate()!=u)throw"Invalid date";return I},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 q=function(b){(b=s+1<a.length&&a.charAt(s+1)==b)&&s++;return b},
|
|
n=function(a,b,c){b=""+b;if(q(a))for(;b.length<c;)b="0"+b;return b},t=function(a,b,c,d){return q(a)?d[b]:c[b]},u="",z=!1;if(b)for(var s=0;s<a.length;s++)if(z)"'"!=a.charAt(s)||q("'")?u+=a.charAt(s):z=!1;else switch(a.charAt(s)){case "d":u+=n("d",b.getDate(),2);break;case "D":u+=t("D",b.getDay(),d,e);break;case "o":u+=n("o",(b.getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864E5,3);break;case "m":u+=n("m",b.getMonth()+1,2);break;case "M":u+=t("M",b.getMonth(),m,c);break;case "y":u+=q("y")?b.getFullYear():
|
|
(10>b.getYear()%100?"0":"")+b.getYear()%100;break;case "@":u+=b.getTime();break;case "!":u+=1E4*b.getTime()+this._ticksTo1970;break;case "'":q("'")?u+="'":z=!0;break;default:u+=a.charAt(s)}return u},_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 q=this._getFormatConfig(a);try{e=this.parseDate(c,d,q)||m}catch(n){this.log(n),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"),q=this._getNumberOfMonths(b),n=this._get(b,"showCurrentAtPos"),t=this._get(b,"stepMonths"),u=1!=q[0]||1!=q[1],z=this._daylightSavingAdjust(b.currentDay?new Date(b.currentYear,b.currentMonth,b.currentDay):new Date(9999,9,9)),s=this._getMinMaxDate(b,"min"),A=this._getMinMaxDate(b,"max"),n=b.drawMonth-n,B=b.drawYear;0>n&&(n+=12,B--);if(A)for(var w=this._daylightSavingAdjust(new Date(A.getFullYear(),
|
|
A.getMonth()-q[0]*q[1]+1,A.getDate())),w=s&&w<s?s:w;this._daylightSavingAdjust(new Date(B,n,1))>w;)n--,0>n&&(n=11,B--);b.drawMonth=n;b.drawYear=B;var w=this._get(b,"prevText"),w=m?this.formatDate(w,this._daylightSavingAdjust(new Date(B,n-t,1)),this._getFormatConfig(b)):w,w=this._canAdjustMonth(b,-1,B,n)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._adjustDate('#"+b.id+"', -"+t+", 'M');\" title=\""+w+'"><span class="ui-icon ui-icon-circle-triangle-'+(d?"e":"w")+
|
|
'">'+w+"</span></a>":l?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+w+'"><span class="ui-icon ui-icon-circle-triangle-'+(d?"e":"w")+'">'+w+"</span></a>",v=this._get(b,"nextText"),v=m?this.formatDate(v,this._daylightSavingAdjust(new Date(B,n+t,1)),this._getFormatConfig(b)):v,l=this._canAdjustMonth(b,1,B,n)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._adjustDate('#"+b.id+"', +"+t+", 'M');\" title=\""+v+'"><span class="ui-icon ui-icon-circle-triangle-'+
|
|
(d?"w":"e")+'">'+v+"</span></a>":l?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+v+'"><span class="ui-icon ui-icon-circle-triangle-'+(d?"w":"e")+'">'+v+"</span></a>",t=this._get(b,"currentText"),v=this._get(b,"gotoCurrent")&&b.currentDay?z:c,t=m?this.formatDate(t,v,this._getFormatConfig(b)):t,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,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+e+".datepicker._gotoToday('#"+b.id+"');\">"+t+"</button>":"")+(d?"":m)+"</div>":"",m=parseInt(this._get(b,"firstDay"),10),m=isNaN(m)?0:m,t=this._get(b,"showWeek"),v=this._get(b,"dayNames");this._get(b,"dayNamesShort");var C=this._get(b,"dayNamesMin"),G=this._get(b,
|
|
"monthNames"),I=this._get(b,"monthNamesShort"),E=this._get(b,"beforeShowDay"),K=this._get(b,"showOtherMonths"),D=this._get(b,"selectOtherMonths");this._get(b,"calculateWeek");for(var F=this._getDefaultDate(b),P="",r=0;r<q[0];r++){for(var R="",M=0;M<q[1];M++){var L=this._daylightSavingAdjust(new Date(B,n,b.selectedDay)),J=" ui-corner-all",N="";if(u){N+='<div class="ui-datepicker-group';if(1<q[1])switch(M){case 0:N+=" ui-datepicker-group-first";J=" ui-corner-"+(d?"right":"left");break;case q[1]-1:N+=
|
|
" ui-datepicker-group-last";J=" ui-corner-"+(d?"left":"right");break;default:N+=" ui-datepicker-group-middle",J=""}N+='">'}for(var N=N+('<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+J+'">'+(/all|left/.test(J)&&0==r?d?l:w:"")+(/all|right/.test(J)&&0==r?d?w:l:"")+this._generateMonthYearHeader(b,n,B,s,A,0<r||0<M,G,I)+'</div><table class="ui-datepicker-calendar"><thead><tr>'),T=t?'<th class="ui-datepicker-week-col">'+this._get(b,"weekHeader")+"</th>":"",J=0;7>J;J++)var O=(J+m)%
|
|
7,T=T+("<th"+(5<=(J+m+6)%7?' class="ui-datepicker-week-end"':"")+'><span title="'+v[O]+'">'+C[O]+"</span></th>");N+=T+"</tr></thead><tbody>";T=this._getDaysInMonth(B,n);B==b.selectedYear&&n==b.selectedMonth&&(b.selectedDay=Math.min(b.selectedDay,T));for(var J=(this._getFirstDayOfMonth(B,n)-m+7)%7,T=u?6:Math.ceil((J+T)/7),O=this._daylightSavingAdjust(new Date(B,n,1-J)),W=0;W<T;W++){for(var N=N+"<tr>",Z=t?'<td class="ui-datepicker-week-col">'+this._get(b,"calculateWeek")(O)+"</td>":"",J=0;7>J;J++){var X=
|
|
E?E.apply(b.input?b.input[0]:null,[O]):[!0,""],aa=O.getMonth()!=n,U=aa&&!D||!X[0]||s&&O<s||A&&O>A,Z=Z+('<td class="'+(5<=(J+m+6)%7?" ui-datepicker-week-end":"")+(aa?" ui-datepicker-other-month":"")+(O.getTime()==L.getTime()&&n==b.selectedMonth&&b._keyEvent||F.getTime()==O.getTime()&&F.getTime()==L.getTime()?" "+this._dayOverClass:"")+(U?" "+this._unselectableClass+" ui-state-disabled":"")+(aa&&!K?"":" "+X[1]+(O.getTime()==z.getTime()?" "+this._currentClass:"")+(O.getTime()==c.getTime()?" ui-datepicker-today":
|
|
""))+'"'+(aa&&!K||!X[2]?"":' title="'+X[2]+'"')+(U?"":' onclick="DP_jQuery_'+e+".datepicker._selectDay('#"+b.id+"',"+O.getMonth()+","+O.getFullYear()+', this);return false;"')+">"+(aa&&!K?" ":U?'<span class="ui-state-default">'+O.getDate()+"</span>":'<a class="ui-state-default'+(O.getTime()==c.getTime()?" ui-state-highlight":"")+(O.getTime()==z.getTime()?" ui-state-active":"")+(aa?" ui-priority-secondary":"")+'" href="#">'+O.getDate()+"</a>")+"</td>");O.setDate(O.getDate()+1);O=this._daylightSavingAdjust(O)}N+=
|
|
Z+"</tr>"}n++;11<n&&(n=0,B++);N+="</tbody></table>"+(u?"</div>"+(0<q[0]&&M==q[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");R+=N}P+=R}P+=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 P},_generateMonthYearHeader:function(b,c,d,k,l,m,q,n){var t=this._get(b,"changeMonth"),u=this._get(b,"changeYear"),z=this._get(b,"showMonthAfterYear"),s='<div class="ui-datepicker-title">',
|
|
A="";if(m||!t)A+='<span class="ui-datepicker-month">'+q[c]+"</span>";else{q=k&&k.getFullYear()==d;for(var B=l&&l.getFullYear()==d,A=A+('<select class="ui-datepicker-month" onchange="DP_jQuery_'+e+".datepicker._selectMonthYear('#"+b.id+"', this, 'M');\" onclick=\"DP_jQuery_"+e+".datepicker._clickMonthYear('#"+b.id+"');\">"),w=0;12>w;w++)(!q||w>=k.getMonth())&&(!B||w<=l.getMonth())&&(A+='<option value="'+w+'"'+(w==c?' selected="selected"':"")+">"+n[w]+"</option>");A+="</select>"}z||(s+=A+(!m&&t&&u?
|
|
"":" "));b.yearshtml="";if(m||!u)s+='<span class="ui-datepicker-year">'+d+"</span>";else{n=this._get(b,"yearRange").split(":");var v=(new Date).getFullYear();q=function(a){a=a.match(/c[+-].*/)?d+parseInt(a.substring(1),10):a.match(/[+-].*/)?v+parseInt(a,10):parseInt(a,10);return isNaN(a)?v:a};c=q(n[0]);n=Math.max(c,q(n[1]||""));c=k?Math.max(c,k.getFullYear()):c;n=l?Math.min(n,l.getFullYear()):n;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<=n;c++)b.yearshtml+='<option value="'+c+'"'+(c==d?' selected="selected"':"")+">"+c+"</option>";b.yearshtml+="</select>";a.browser.mozilla?s+='<select class="ui-datepicker-year"><option value="'+d+'" selected="selected">'+d+"</option></select>":(s+=b.yearshtml,b.yearshtml=null)}s+=this._get(b,"yearSuffix");z&&(s+=(!m&&t&&u?"":" ")+A);return s+"</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")||
|
|
" ",A=e(d.call(this)),B,w=k.attr("className");a.each(l,function(a,c){b[c]&&k[c+"Class"](b[c])});B=e(d.call(this));k.attr("className",w);k.animate(f(A,B),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)});A=a.queue(this);B=A.splice(A.length-1,1)[0];A.splice(1,0,B);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=0.5;break;case "bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case "left":a=
|
|
0;break;case "center":a=0.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=0.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-=1))*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=0.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=1.5*0.3*e);g<Math.abs(d)?(g=d,a=f/4):a=f/(2*Math.PI)*Math.asin(d/g);return 1>b?-0.5*g*Math.pow(2,10*(b-=1))*Math.sin(2*(b*e-a)*Math.PI/f)+c:0.5*g*Math.pow(2,-10*(b-=1))*Math.sin(2*(b*e-a)*Math.PI/f)+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+0.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+0.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+0.984375)+c},easeInOutBounce:function(b,c,d,e,f){return c<f/2?0.5*a.easing.easeInBounce(b,2*c,0,e,f)+d:0.5*a.easing.easeOutBounce(b,
|
|
2*c-f,0,e,f)+0.5*e+d}})}(jQuery);function cursorCss(a,b,c){c||(c="light");a=TradingView.wrapUrl("url("+TradingView.resourceFullPath(c+"/"+a+".cur")+")");return $.browser.msie?a+", default":a+" "+b+", default"};(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,t,u,z=f,s,A=d[a];A&&"object"===typeof A&&"function"===typeof A.toJSON&&(A=A.toJSON(a));"function"===typeof k&&(A=k.call(d,a,A));switch(typeof A){case "string":return b(A);case "number":return isFinite(A)?String(A):"null";case "boolean":case "null":return String(A);case "object":if(!A)return"null";
|
|
f+=g;s=[];if("[object Array]"===Object.prototype.toString.apply(A)){u=A.length;for(e=0;e<u;e+=1)s[e]=c(e,A)||"null";t=0===s.length?"[]":f?"[\n"+f+s.join(",\n"+f)+"\n"+z+"]":"["+s.join(",")+"]";f=z;return t}if(k&&"object"===typeof k)for(u=k.length,e=0;e<u;e+=1)h=k[e],"string"===typeof h&&(t=c(h,A))&&s.push(b(h)+(f?": ":":")+t);else for(h in A)Object.hasOwnProperty.call(A,h)&&(t=c(h,A))&&s.push(b(h)+(f?": ":":")+t);t=0===s.length?"{}":f?"{\n"+f+s.join(",\n"+f)+"\n"+z+"}":"{"+s.join(",")+"}";f=z;return t}}
|
|
"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){a.extend(a.fn,{swapClass:function(a,b){var e=this.filter("."+a);this.filter("."+b).removeClass(b).addClass(a);e.removeClass(a).addClass(b);return this},replaceClass:function(a,b){return this.filter("."+a).removeClass(a).addClass(b).end()},hoverClass:function(b){b=b||"hover";return this.hover(function(){a(this).addClass(b)},function(){a(this).removeClass(b)})},heightToggle:function(a,b){a?this.animate({height:"toggle"},a,b):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?
|
|
"show":"hide"]();b&&b.apply(this,arguments)})},heightHide:function(a,b){a?this.animate({height:"hide"},a,b):(this.hide(),b&&this.each(b))},prepareBranches:function(a){a.prerendered||(this.filter(":last-child:not(ul)").addClass(b.last),this.filter((a.collapsed?"":"."+b.closed)+":not(."+b.open+")").find(">ul").hide());return this.filter(":has(>ul)")},applyClasses:function(c,d){this.filter(":has(>ul):not(:has(>a))").find(">span").unbind("click.treeview").bind("click.treeview",function(b){this==b.target&&
|
|
d.apply(a(this).next())}).add(a("a",this)).hoverClass();if(!c.prerendered){this.filter(":has(>ul:hidden)").addClass(b.expandable).replaceClass(b.last,b.lastExpandable);this.not(":has(>ul:hidden)").addClass(b.collapsable).replaceClass(b.last,b.lastCollapsable);var e=this.find("div."+b.hitarea);e.length||(e=this.prepend('<div class="'+b.hitarea+'"/>').find("div."+b.hitarea));e.removeClass().addClass(b.hitarea).each(function(){var b="";a.each(a(this).parent().attr("class").split(" "),function(){b+=this+
|
|
"-hitarea "});a(this).addClass(b)})}this.find("div."+b.hitarea).click(d)},treeview:function(c){function d(c,d){function f(d){return function(){e.apply(a("div."+b.hitarea,c).filter(function(){return d?a(this).parent("."+d).length:!0}));return!1}}a("a:eq(0)",d).click(f(b.collapsable));a("a:eq(1)",d).click(f(b.expandable));a("a:eq(2)",d).click(f())}function e(){a(this).parent().find(">.hitarea").swapClass(b.collapsableHitarea,b.expandableHitarea).swapClass(b.lastCollapsableHitarea,b.lastExpandableHitarea).end().swapClass(b.collapsable,
|
|
b.expandable).swapClass(b.lastCollapsable,b.lastExpandable).find(">ul").heightToggle(c.animated,c.toggle);c.unique&&a(this).parent().siblings().find(">.hitarea").replaceClass(b.collapsableHitarea,b.expandableHitarea).replaceClass(b.lastCollapsableHitarea,b.lastExpandableHitarea).end().replaceClass(b.collapsable,b.expandable).replaceClass(b.lastCollapsable,b.lastExpandable).find(">ul").heightHide(c.animated,c.toggle)}function f(){var b=[];k.each(function(c,d){b[c]=a(d).is(":has(>ul:visible)")?1:0});
|
|
a.cookie(c.cookieId,b.join(""),c.cookieOptions)}function g(){var b=a.cookie(c.cookieId);if(b){var d=b.split("");k.each(function(b,c){a(c).find(">ul")[parseInt(d[b])?"show":"hide"]()})}}c=a.extend({cookieId:"treeview"},c);if(c.toggle){var h=c.toggle;c.toggle=function(){return h.apply(a(this).parent()[0],arguments)}}this.data("toggler",e);this.addClass("treeview");var k=this.find("li").prepareBranches(c);switch(c.persist){case "cookie":var l=c.toggle;c.toggle=function(){f();l&&l.apply(this,arguments)};
|
|
g();break;case "location":var m=this.find("a").filter(function(){return this.href.toLowerCase()==location.href.toLowerCase()});m.length&&(m=m.addClass("selected").parents("ul, li").add(m.next()).show(),c.prerendered&&m.filter("li").swapClass(b.collapsable,b.expandable).swapClass(b.lastCollapsable,b.lastExpandable).find(">.hitarea").swapClass(b.collapsableHitarea,b.expandableHitarea).swapClass(b.lastCollapsableHitarea,b.lastExpandableHitarea))}k.applyClasses(c,e);c.control&&(d(this,c.control),a(c.control).show());
|
|
return this}});a.treeview={};var b=a.treeview.classes={open:"open",closed:"closed",expandable:"expandable",expandableHitarea:"expandable-hitarea",lastExpandableHitarea:"lastExpandable-hitarea",collapsable:"collapsable",collapsableHitarea:"collapsable-hitarea",lastCollapsableHitarea:"lastCollapsable-hitarea",lastCollapsable:"lastCollapsable",lastExpandable:"lastExpandable",last:"last",hitarea:"hitarea"}})(jQuery);(function(a){function b(a){for(var b=0;b<arguments.length;b++)if(!isNaN(parseFloat(arguments[b])))return Number(parseFloat(arguments[b]))}function c(b,c){var f=a(c||this).attr("class"),f=RegExp("(\\b"+b+")(\\S*)").exec(f),g={"true":!0,True:!0,"false":!1,False:!1};f&&3<=f.length&&void 0!==g[f[3]]&&(f[3]=g[f[3]]);return f?3<=f.length?f[2]:null:void 0}a.fn.spinbox=function(d){if(d&&"String"===typeof d&&"destroy"===d)return this.unbind(".spinbox").removeClass(d.spinboxClass).removeClass(d.upClass).removeClass(d.downClass).removeClass(d.upHoverClass).removeClass(d.downHoverClass).removeData("spinboxMin").removeData("spinboxMax").removeData("spinboxReset").removeData("spinboxStep").removeData("spinboxBigStep");
|
|
d=a.extend({},a.fn.spinbox.defaults,d);this.each(function(){var e=a(this),f=c("spinboxMin",this),g=c("spinboxMax",this),h=c("spinboxStep",this),k=c("spinboxBigStep",this),l=c("spinboxReset",this),m=c("spinboxScale",this);void 0===f&&(f=b(e.attr("min"),d.min));void 0===g&&(g=b(e.attr("max"),d.max));h||(h=b(e.attr("step"),d.step));k||(k=b(e.attr("bigStep"),d.bigStep));void 0===l&&(l=b(d.reset,e.val(),f,g));void 0===m&&(m=e.data("spinboxScale"));m=m||!isNaN(parseFloat(m))?m:d.scale;!0===m&&(m=(h.toString().split(".")[1]||
|
|
"").length);e.data("spinboxMin",f);e.data("spinboxMax",g);e.data("spinboxStep",h);e.data("spinboxBigStep",k);e.data("spinboxReset",l);e.data("spinboxScale",m)});return this.each(function(){function c(e,f,g){e=a(this);if(!d.ignore||!e.is(d.ignore)){f=b(f,e.data("spinboxStep"),1);g=g||(k?-1:1);var h=e.val(),l=b(h,e.data("spinboxReset"),0),m=b(e.data("spinboxMin")),q=b(e.data("spinboxMax")),w=[l,f,m,q,g,h,d];0<g?l=d.increment.apply(this,w):0>g&&(l=d.decrement.apply(this,w));w=e.data("spinboxScale");
|
|
!isNaN(parseFloat(w))&&d.round&&(l=d.round(l,e.data("spinboxScale")));isNaN(parseFloat(m))||(l=Math.max(l,m));isNaN(parseFloat(q))||(l=Math.min(l,q));w=[l,f,m,q,g,h,d];l!=h&&!1!==e.triggerHandler("beforeSpin",w)&&(e.val(l),d.change&&e.trigger("change",w),e.triggerHandler("spin",w))}}function f(a,b){g();l=window.setTimeout(function(){c.apply(a,[b]);m=window.setInterval(function(){c.apply(a,[b])},d.repeat)},d.delay)}function g(){window.clearTimeout(l);window.clearInterval(m)}var h,k,l,m,q=a(this);q.bind("mousemove.spinbox",
|
|
function(b){var c=a(this),e=c.offset(),f=c.height()/2,g=b.pageX>e.left+c.width()-d.buttonWidth;h=g&&b.pageY<=e.top+f;k=g&&b.pageY>e.top+f;c.toggleClass(d.upHoverClass,h).toggleClass(d.downHoverClass,k)});q.bind("mouseout.spinbox",function(){g();a(this).removeClass([d.upClass,d.downClass,d.upHoverClass,d.downHoverClass].join(" "));h=k=null});q.bind("mousedown.spinbox",function(b){if(h||k)a(this).toggleClass(d.upClass,h).toggleClass(d.downClass,k),c.apply(this,[b]),f(this,b)});q.bind("mouseup.spinbox",
|
|
function(b){g();a(this).removeClass(d.upClass).removeClass(d.downClass)});q.bind("keydown.spinbox",function(b){if(!d.keys||a.grep(d.keys,function(a){return a===b.keyCode||a instanceof RegExp&&a.test(String.fromCharCode(b.keyCode))}).length){var f=a(this),g=f.data("spinboxBigStep"),f=b.shiftKey?g:f.data("spinboxStep");switch(b.keyCode){case 38:c.apply(this,[b,f,1]);break;case 40:c.apply(this,[b,f,-1]);break;case 33:c.apply(this,[b,g,1]);break;case 34:c.apply(this,[b,g,-1])}}else return!d.keys});q.bind("change.spinbox",
|
|
function(a){c.apply(this,[a,0])});q.addClass(d.spinboxClass);d.mousewheel&&a(this).bind("mousewheel.spinbox DOMMouseScroll.spinbox",function(b){var d=b.shiftKey?a(this).data("spinboxBigStep"):a(this).data("spinboxStep");0>b.detail||120<=b.wheelDelta?c.apply(this,[b,d,1]):(0<b.detail||-120>=b.wheelDelta)&&c.apply(this,[b,d,-1]);return!1});c.apply(this,[a.Event(),0])})};a.fn.spinbox.defaults={min:0,max:null,step:1,bigStep:10,keys:[/[0-9]/,9,13,8,46,33,34,37,38,39,40,109,188,190],ignore:"[readonly],[disabled]",
|
|
spinboxClass:"spinbox-active",upClass:"spinbox-up",downClass:"spinbox-down",upHoverClass:"spinbox-up-hover",downHoverClass:"spinbox-down-hover",mousewheel:!0,change:!0,increment:function(a,b,c,g,h){return a+b},decrement:function(a,b,c,g,h){return a-b},reset:null,delay:500,repeat:100,buttonWidth:20,scale:!0,round:function(a,b){return Math.round(a*Math.pow(10,b))/Math.pow(10,b)}}})(jQuery);(function(a){a.fn.popup=function(){return a(this).each(function(a,c){HTMLHelper.createPopup(c)})}})(jQuery);(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);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,n;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),n=d.listener.apply(this,b||[]),n===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);D76=function(){var a={};if("undefined"!=typeof D76)return D76;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:{},header_fullscreen_button:{},header_symbol_search:{},
|
|
header_resolutions:{},header_chart_type:{},header_settings:{},header_indicators:{},header_compare:{},header_undo_redo:{},header_screenshot:{},header_saveload:{},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_screenshot header_fullscreen_button".split(" ")},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:{},use_localstorage_for_settings:{subsets:["items_favoriting"]},plain_studymarket:{},trading_options:{},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:{},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 save_old_chart_before_save_as".split(" ")},
|
|
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 header_widget_dom_node header_symbol_search header_resolutions header_chart_type header_indicators header_compare".split(" ")},charting_library:{subsets:"daily_timeframe_suffix custom_items_in_context_menu pay_attention_to_ticker_not_symbol graying_disabled_tools_enabled update_study_formatter_on_symbol_resolve constraint_dialogs_movement header_widget left_toolbar control_bar widget_logo timeframes_toolbar context_menus edit_buttons_in_legend use_localstorage_for_settings plain_studymarket border_around_the_chart saveload_storage_customization volume_force_overlay header_fullscreen_button lean_chart_load stop_study_on_restart header_saveload create_volume_indicator_by_default adapt_onchart_logo_background update_timeframes_set_on_symbol_resolve refresh_saved_charts_list_on_dialog_show".split(" ")},
|
|
static_charts_service:{subsets:["charting_library","disable_resolution_rebuild","log_data_request_time","same_data_requery"]},charting_platform:{subsets:["charting_library","trading_options"]}},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(!1==k[a])return!1;
|
|
a=k[a];for(var c=0;c<b.length;++c)a|=D76.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=D76);var 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){D76.enabled("charting_library")&&(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/.test(window.location.pathname)};TradingView.availableTimezones=TradingView.availableTimezones||[{id:"UTC",title:"UTC"},{id:"EST",title:"EST"},{id:"CST",title:"CST"},{id:"PST",title:"PST"},{id:"exchange",title:"Exchange"}];TradingView.monthsShort="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ");Q2={};Q2._keyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";Q2.decode=function(a){for(var b=[],c=0;c<a.length;){var d=this._keyStr.indexOf(a.charAt(c++)),e=this._keyStr.indexOf(a.charAt(c++)),f=this._keyStr.indexOf(a.charAt(c++)),g=this._keyStr.indexOf(a.charAt(c++)),h=(e&15)<<4|f>>2,k=(f&3)<<6|g;b.push(d<<2|e>>4);64!==f&&b.push(h);64!==g&&b.push(k)}return b};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(){for(var a="",b=0;12>b;b++)var c=Math.round(60*Math.random()),a=a+"0123456789abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[c];return a};isArray=Array.isArray||function(a){return"[object Array]"===Object.prototype.toString.call(a)};function isInteger(a){return"number"===typeof a&&0===a%1}function isNumber(a){return"number"===typeof a&&isFinite(a)}function parseBool(a){return!0===a||"true"===a}function isBoolean(a){return!0===a||!1===a}function isString(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}function declareClassAsPureInterface(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";})}
|
|
function requireFullInterfaceImplementation(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";}function isInherited(a,b){if(a===b)return!0;if(a&&a.prototype)return void 0===a.prototype.superclass||null===a.prototype.superclass?!1:a.prototype.superclass===b?!0:isInherited(a.prototype.superclass,b);debugger;return!1}function TypeValidator(a){this.m_type=a}
|
|
TypeValidator.prototype.check=function(a){return a.constructor===this.m_type||isInherited(a.constructor,this.m_type)};function PredicateValidator(a){this.m_predicate=a}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(isString(a)&&isString(b))return[a===b,c];if(isArray(a)&&isArray(b)){var d=a.length;if(d!==b.length)return[!1,c];for(var e=0;e<d;e++)if(res=TradingView.deepEquals(a[e],b[e],c+"["+e+"]"),!res[0])return res}else{if(isArray(a)||isArray(b))return[!1,c];for(d in a)if(res=TradingView.deepEquals(a[d],
|
|
b[d],c+"["+d+"]"),!res[0])return res}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,isBoolean:isBoolean,isString:isString});function OrderedHash(a,b){this.array=[];for(var c in a)a[c].key=c,this.array.push(a[c]);this.rearrange(b)}OrderedHash.prototype.rearrange=function(a){if("function"!==typeof a)throw Error("sort param is not a function");return this.array.sort(a)};OrderedHash.byValue=function(a){return function(a,c){return a-c}};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}};
|
|
OrderedHash.byOrder=function(a){return function(b,c){var d=a.indexOf(b.key),e=a.indexOf(c.key);return d-e}};var HTMLHelper={};
|
|
(function(a){HTMLHelper.createLabel=function(b,c,d){return HTMLHelper.Element.create("label",a.extend(d,{html:c,"for":b}))};HTMLHelper.unbindContextMenu=function(a){a.contextMenu(function(a){return!1})};HTMLHelper.offsetX=function(a,c){return a.width()+c.pageX};HTMLHelper.offsetY=function(a,c){return a.height()+c.pageY};HTMLHelper.checkObjIsOutOfWindowX=function(b,c){var d=a(window).width()-HTMLHelper.offsetX(b,c);return 0>d?(d=c.pageX+d,0<d?d:0):c.pageX};HTMLHelper.checkObjIsOutOfWindowY=function(b,
|
|
c){var d=a(window).height()-HTMLHelper.offsetY(b,c);return 0>d?(d=c.pageY+d,0<d?d:0):c.pageY};HTMLHelper.checkObjIsOutOfWindow=function(a,c){return{left:HTMLHelper.checkObjIsOutOfWindowX(a,c),top:HTMLHelper.checkObjIsOutOfWindowY(a,c)}};HTMLHelper.setAttr=function(a,c,d){a.attr?a.attr(c,d):a[c]=d;return a};HTMLHelper.removeAttr=function(a,c){a.removeAttr?a.removeAttr(c):a.removeAttribute(c);return a};HTMLHelper.notNull=function(b){return-1==a.inArray(b,[null,void 0,"false","null","undefined",0])};
|
|
HTMLHelper.hideControl=function(a){return a.css({position:"absolute",top:-1E3,left:-1E3})};HTMLHelper.createPopup=function(a,c,d){return(new HTMLHelper.Popup(a,c,d)).render()};HTMLHelper.Popup=function(b,c,d){this.jqDiv=void 0!==b.selector?b:b.nodeType?a(b):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};HTMLHelper.Popup.prototype.render=function(){return this.jqDiv};HTMLHelper.Popup.prototype.show=
|
|
function(){this.jqDiv.show()};HTMLHelper.Popup.prototype.hide=function(){this.jqDiv.hide()};HTMLHelper.Popup.prototype.setVisible=function(a){a?this.show():this.hide()};HTMLHelper.Popup.prototype.isVisible=function(){return this.jqDiv.is(":visible")};HTMLHelper.Popup.prototype.contextMenuEvent=function(a){return!1};HTMLHelper.Popup.prototype.mouseDownOutsideEvent=function(a){!this.isVisible()||this._callback&&!this._callback()||this.hide()}})(jQuery);HTMLHelper.Element={};HTMLHelper.Element.renderAttributes=function(a){var b="";for(attr in a)a[attr]&&(b+=" "+attr+'="'+a[attr]+'"');return b};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};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(" ");
|
|
HTMLHelper.Element.validAttribute=function(a){return-1!=jQuery.inArray(a,HTMLHelper.Element.validAttributes)};HTMLHelper.Element.cleanAttributes=function(a){jQuery.each(a,function(b,c){HTMLHelper.Element.validAttribute(b)||delete a[b]});return a};HTMLHelper.CUSTOM_SELECT_MINIMAL_WIDTH=100;HTMLHelper.Input=function(a){this.jqObj=null;this.data=a;this.init();this._prepareValue();this._prepareCallback();this._prepareChildren();this._applyAttributes();return this.jqObj};HTMLHelper.Input.selectOptions={type:"option",value:null,html:null};HTMLHelper.Input.optionsData={radiogroup:{type:"radio",name:null,value:null,label:null},select:HTMLHelper.Input.selectOptions,"select-one":HTMLHelper.Input.selectOptions,"select-multiple":HTMLHelper.Input.selectOptions};
|
|
HTMLHelper.Input.customTypes=["radiogroup","fontpicker","colorpicker","combobox"];HTMLHelper.Input.prototype._tagIsInput=function(a){return-1!=jQuery.inArray(this.data.type,"text radio checkbox hidden reset image file".split(" "))};HTMLHelper.Input.prototype.init=function(){this._tagIsInput()?this.jqObj=HTMLHelper.Element.create("input",{name:this.data.name,type:this.data.type}):this.jqObj=HTMLHelper.Element.create(this.data.type,{name:this.data.name})};
|
|
HTMLHelper.Input.prototype._eventIsKeyUp=function(){return-1!=jQuery.inArray(this.data.type,["text","textarea"])};HTMLHelper.Input.prototype._eventIsClick=function(){return-1!=jQuery.inArray(this.data.type,["checkbox","radio","option"])};HTMLHelper.Input.prototype._eventIsChange=function(){return-1!=jQuery.inArray(this.data.type,["select","select-one","select-multiple","radiogroup"])};
|
|
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)};HTMLHelper.Input.prototype._childTag=function(){return{select:"option","select-one":"option","select-multiple":"option",radiogroup:"radio"}[this.data.type]};
|
|
HTMLHelper.Input.prototype._inheritedProperties=function(){var a={type:this._childTag()};"radiogroup"==this.data.type&&(a.name=this.data.name);return a};HTMLHelper.Input.prototype._extendChildProps=function(a){var b=jQuery.extend(this._inheritedProperties(),a);this.data.value==a.value&&(b.selected=!0);return b};HTMLHelper.Input.prototype._prepareChildren=function(){if(this.data.options){var a=this;jQuery.each(this.data.options,function(b,c){a.jqObj.append(new HTMLHelper.Input(a._extendChildProps(c)))})}};
|
|
HTMLHelper.Input.prototype.isCustom=function(){return-1!=jQuery.inArray(this.data.type,this.customTypes)};HTMLHelper.Input.prototype._isStoringValue=function(){return-1!=jQuery.inArray(this.data.type,["text","textarea","option","radio","checkbox"])};HTMLHelper.Input.prototype._htmlAsValue=function(){return"textarea"==this.data.type};HTMLHelper.Input.prototype._valAsValue=function(){return jQuery.inArray(this.data.type,"text checkbox radio option select select-one select-multiple".split(" "))};
|
|
HTMLHelper.Input.prototype._getControlValue=function(){return{checkbox:1}[this.data.type]||this.data.value};HTMLHelper.Input.prototype._setControlValue=function(){this._valAsValue()?this.jqObj.val(this._getControlValue()):this._htmlAsValue()&&this.jqObj.html(this.data.value)};HTMLHelper.Input.prototype._getCheckedAttr=function(){return{option:"selected",radio:"checked",checkbox:"checked"}[this.data.type]};
|
|
HTMLHelper.Input.prototype._setChecked=function(){this.data.selected&&this.jqObj.attr(this._getCheckedAttr(),!0)};HTMLHelper.Input.prototype._setValue=function(){this._setControlValue();HTMLHelper.Input.isCheckable(this.data.type)&&this._setChecked()};HTMLHelper.Input.prototype._prepareValue=function(){this._isStoringValue()&&this._setValue()};HTMLHelper.Input.prototype._applyAttributes=function(){this.jqObj.attr(HTMLHelper.Element.cleanAttributes(this.data))};
|
|
HTMLHelper.Input.value=function(a){return HTMLHelper.Input.controlCheckable(a)?a.checked:a.value};HTMLHelper.Input.isCheckable=function(a){return-1!=jQuery.inArray(a,["checkbox","radio","option"])};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")};HTMLHelper.Input.controlCheckable=function(a){return HTMLHelper.Input.isCheckable(HTMLHelper.Input.controlType(a))};
|
|
HTMLHelper.Input.controlToggleChecked=function(a,b){return HTMLHelper.setAttr(a,"checked",b)};HTMLHelper.Input.controlSetValue=function(a,b){return HTMLHelper.Input.controlCheckable(a)?HTMLHelper.Input.controlToggleChecked(a,b):HTMLHelper.setAttr(a,"value",b)};HTMLHelper.Input.currentOption=function(a){return a.options[a.selectedIndex]};HTMLHelper.Input.currentOptionInnerHTML=function(a){return HTMLHelper.Input.currentOption(a).innerHTML};
|
|
HTMLHelper.ComboboxItem=function(a,b){this.value=a;this.html=b||"";this.jqItem=this._render()};HTMLHelper.ComboboxItem.prototype.eq=function(a){return this.value===a};HTMLHelper.ComboboxItem.prototype.width=function(a){return this.jqItem.width()};HTMLHelper.ComboboxItem.prototype._render=function(a){a=$("<span/>").append(this.html);return $('<div class="item"></div>').append(a)};HTMLHelper.ComboboxItem.prototype.render=function(a){return this.jqItem};
|
|
HTMLHelper.ComboboxItem.prototype.select=function(a){a?this.jqItem.addClass("selected"):this.jqItem.removeClass("selected")};HTMLHelper.ComboboxItem.prototype.selectAndReturnIfValueMatch=function(a){if(this.eq(a))return this.select(!0),this;this.select(!1);return null};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()};
|
|
HTMLHelper.Combobox.prototype._init=function(){this._initWrapper();this._initSwitcher();this._initOptions()};HTMLHelper.Combobox.prototype._initTitle=function(){this.jqTitle=$('<span class="title" />')};HTMLHelper.Combobox.prototype._initIcon=function(){this.jqIcon=$('<span class="icon" />')};HTMLHelper.Combobox.prototype._initOptions=function(){this.jqItems=HTMLHelper.createPopup({"class":"items"})};
|
|
HTMLHelper.Combobox.prototype._initWrapper=function(){this.jqWrapper=$('<div class="custom-select" />');this.jqWrapper.data({disable:this.disable.bind(this),enable:this.enable.bind(this)})};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);this.jqSwitcher.click(function(b){a.toggleItems()})};
|
|
HTMLHelper.Combobox.prototype.toggleItems=function(){this.disabled()||this.jqItems.toggle()};HTMLHelper.Combobox.prototype.setWidth=function(){this.jqWrapper.width(this.width)};HTMLHelper.Combobox.prototype.joinParts=function(){this.jqWrapper.append(this.jqSwitcher);this.jqWrapper.append(this.jqItems);this.jqWrapper.selectable(!1)};HTMLHelper.Combobox.prototype.render=function(){return this.jqWrapper};
|
|
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};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()}};HTMLHelper.Combobox.prototype.change=function(a){a?this.callback=a:this.callback&&this.callback.call(this)};HTMLHelper.Combobox.prototype.value=function(){return this._value};
|
|
HTMLHelper.Combobox.prototype.val=function(a){if(void 0!==a)this.setValue(a);else return this.value()};HTMLHelper.Combobox.prototype.addItems=function(a){var b=this;$(a).each(function(a,d){b.addItem(d.value,d.html)})};HTMLHelper.Combobox.prototype.addItem=function(a,b){var c=this,d=new 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)};
|
|
HTMLHelper.Combobox.prototype.disable=function(){this._disabled=!0};HTMLHelper.Combobox.prototype.enable=function(){this._disabled=!1};HTMLHelper.Combobox.prototype.disabled=function(){return this._disabled};function List(a){if(void 0==a)this.m_values=[];else if(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(!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(!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 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(!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};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.logDebug("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.logDebug("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(!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(!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(0.5).add(c).scaled(0.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.size()-1,e=!1,f=b.x,g=b.y,c=0;c<a.size();c++){var h=a.item(c),d=a.item(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){a=(c.x-a.x)*(c.x-a.x)+(c.y-a.y)*(c.y-a.y);radiusQ=b*b;return a<=radiusQ};
|
|
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};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_ABSOLUTE:"Absolute",MARKLOC_ABSOLUTEUP:"AbsoluteUp",MARKLOC_ABSOLUTEDOWN:"AbsoluteDown",HHISTLOC_RELATIVE:"relative",
|
|
HHISTLOC_ABSOLUTE:"absolute",HHISTDIR_LEFTTORIGHT:"left_to_right",HHISTDIR_RIGHTTOLEFT:"right_to_left",computeDashPattern:function(a){return[[a.lineWidth,2*a.lineWidth],[3*a.lineWidth,2*a.lineWidth],[6*a.lineWidth,6*a.lineWidth]][a.lineStyle-1]},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))},drawSolidLine:function(a,b,c,
|
|
d,e){a.beginPath();a.moveTo(b,c);a.lineTo(d,e);a.stroke()},setLineStyle:function(a,b){a.lineStyle=b;if(b!=CanvasEx.LINESTYLE_SOLID){var 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)}},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()},lineStyles:[]};
|
|
"undefined"!==typeof CanvasRenderingContext2D&&(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 q=Math.atan2(d-b,c-a),n=e[l],h=f.cap(c,h+Math.cos(q)*n),k=g.cap(d,k+Math.sin(q)*n);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(!isInteger(a))throw"invalid length";if(a>this.length)throw"invalid length";return this.substring(0,a)};String.prototype.right=function(a){if(!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=new List}Delegate.prototype.subscribe=function(a,b,c){this._listeners.append({object:a,member:b,singleshot:!!c})};Delegate.prototype.unsubscribe=function(a,b){for(var c=0;c<this._listeners.size();++c){var d=this._listeners.item(c);if(d.object===a&&d.member.prototype===b.prototype){this._listeners.removeAt(c);break}}};
|
|
Delegate.prototype.fire=function(a){for(var b=$.extend(!0,{},this._listeners),c=0;c<b.size();++c){var d=b.item(c);d.object?d.member.call(d.object,a):d.member(a)}this._listeners.removeAll(function(a){return a.singleshot})};/*
|
|
Use it if you like it
|
|
*/
|
|
function RGBColor(a){this.ok=!1;"#"==a.charAt(0)&&(a=a.substr(1,6));a=a.replace(/ /g,"");a=a.toLowerCase();var b={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"},c;for(c in b)a==c&&(a=b[c]);b=[{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)]}}];for(c=0;c<b.length;c++){var d=b[c].process,e=b[c].re.exec(a);e&&(channels=d(e),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.cleanupRGB=function(){this.r=0>this.r||isNaN(this.r)?0:255<this.r?255:this.r;this.g=
|
|
0>this.g||isNaN(this.g)?0:255<this.g?255:this.g;this.b=0>this.b||isNaN(this.b)?0:255<this.b?255:this.b};this.cleanupRGB();this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.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};this.grayChannel=function(){var a=[0.199,0.687,0.114];return a[0]*this.r+a[1]*this.g+a[2]*this.b};this.blackWhiteContrast=function(){return 150>
|
|
this.grayChannel()?"white":"black"};this.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=0.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){if(0===b)c=b=a=c;else{var d=function(a,b,c){0>c&&(c+=1);1<c&&(c-=1);return c<1/6?a+6*(b-a)*c:0.5>c?b:c<2/3?a+6*(b-a)*(2/3-c):a},e=0.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)]};function PixelSet(a,b,c){this._rawData=a?a:Array(4*b*c);this._width=b;this._height=c}PixelSet.prototype.rawData=function(){return this._rawData};PixelSet.prototype.width=function(){return this._width};PixelSet.prototype.height=function(){return this._height};PixelSet.prototype.pixel=function(a,b){var c=[],d=4*b*this._width+4*a;c.push(this._rawData[d]);c.push(this._rawData[d+1]);c.push(this._rawData[d+2]);c.push(this._rawData[d+3]);return c};
|
|
PixelSet.prototype.setPixel=function(a,b,c){a=4*b*this._width+4*a;this._rawData[a]=c[0];this._rawData[a+1]=c[1];this._rawData[a+2]=c[2];this._rawData[a+3]=c[3]};
|
|
PixelSet.prototype.blend=function(a,b,c,d,e,f,g){d||(d=this.width());e||(e=this.height());f||(f=0);g||(g=0);for(var h=a.getImageData(b,c,d,e),k=0;k<d;k++)for(var l=0;l<e;l++){var m=4*l*d+4*k,q=this.pixel(f+k,g+l),n=q[1],t=q[2],u=1-q[3]/255;h.data[m]=h.data[m]*u+q[0]*(1-u);h.data[m+1]=h.data[m+1]*u+n*(1-u);h.data[m+2]=h.data[m+2]*u+t*(1-u);h.data[m+3]=Math.max(q[3],h.data[m+3])}a.putImageData(h,b,c)};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};Q68=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(a){this.value=a}function q(a){this.value=a}function n(a){this.value=a}function t(){m.apply(this,arguments)}function u(){q.apply(this,arguments)}function z(a,b){var d=[],e;a:for(;e=G.exec(a);){for(var f=w.length;f--;)if(void 0!==e[f+
|
|
1]){w[f].ctor&&(f=new w[f].ctor(e[f+1]),f._offset=e.index,d.push(f));continue a}f=new n(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 q||e instanceof m?(void 0!==g&&(e=new m(""),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 s(a){for(var b=[],d=0;d<a.length;d++)a[d]instanceof c||b.push(a[d]);return b}function A(a){a=s(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 B(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 q&&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 w=[{pattern:"(",ctor:d},{pattern:")",ctor:e},{pattern:"+",ctor:g},
|
|
{pattern:"-",ctor:h},{pattern:"*",ctor:k},{pattern:"/",ctor:l},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:q},{pattern:/\./,ctor:u},{pattern:D76.enabled("charting_library")?/[a-zA-Z0-9_\u4e00-\u9fa5^][a-zA-Z0-9_\u4e00-\u9fa5_!:\.&]*|'.+?'/:/[a-zA-Z0-9][a-zA-Z0-9_!|:\.&]*|'.+?'/,ctor:m},{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;var v=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,C=/[\+\-\/\*]/;a(m,b);m.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var a=C.test(this._ticker)?"'":"";return a+(this._exchange?this._exchange+
|
|
":":"")+this._ticker+a}return this.value};m.prototype.parse=function(){var a=v.exec(this.value);a[1]&&(this._exchange=a[1]);this._ticker=a[2]};m.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};m.prototype.ticker=function(a){this.hasOwnProperty("_ticker")||this.parse();if(0<arguments.length)null===a||void 0===a?delete this._ticker:this._ticker=a+"";else return this._ticker};
|
|
a(q,b);q.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value};q.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")};n.prototype.toString=function(){return this.value};a(t,m);t.prototype.isIncomplete=!0;t.prototype.incompleteSuggest=function(){if("'"!==this.value)return new String("'")};a(u,q);u.prototype.isIncomplete=!0;var G=RegExp(w.map(function(a){return"("+
|
|
("string"===typeof a.pattern?a.pattern.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g,"\\$&"):a.pattern.source)+")"}).concat(".").join("|"),"g");return{tokenize:z,validate:function(a){if(D76.enabled("charting_library"))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 t={status:"incomplete",reason:"incomplete_token",offset:l._offset,token:l};l.incompleteSuggest&&(t.recover=
|
|
{append:l.incompleteSuggest()});g.warnings.push(t);if(k!==a.length-1){t.status="error";continue}}l instanceof m||l instanceof q?"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 n&&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(),t={status:"incomplete",reason:"unbalanced_brace",offset:l._offset,token:l},"var"==b&&(t.recover={append:new e}),g.warnings.push(t);
|
|
g.currentState=b;0===g.warnings.length&&delete g.warnings;0===g.errors.length&&delete g.errors;return g},factorOutBraces:A,normalizeTokens:function(a){for(var b=0;b<a.length;b++)a[b].parse&&a[b].parse();return a},flip:function(a){var b=B(a);return b?A(b):A([new q("1"),new l,new d].concat(a).concat(new e))},hasBatsSymbols:function(a){if("string"===typeof a)a=z(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
|
|
m&&"BATS"===(a.exchange()||"").toUpperCase()?!0:!1})},hasEodSymbols:function(a){if("string"===typeof a)a=z(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 m&&-1!==(a.exchange()||"").toUpperCase().indexOf("_EOD")?!0:!1})},SymbolToken:m,IncompleteSymbolToken:t,NumberToken:q,BinaryOperatorToken:f,OpenBraceToken:d,CloseBraceToken:e,ticker:function(a){return(new m(a)).ticker()},shortName:function(a){if("string"!==
|
|
typeof a)throw new TypeError("expression must be a string");a=A(s(z(a)));a.forEach(function(a){a instanceof m&&a.exchange(null)});return a.join("")},normalize:function(a){if("string"!==typeof a)throw new TypeError("expression must be a string");return A(s(z(a))).join("")}}}();function ReadonlyWatchedValue(){}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;c<b.length;c++)b[c].once&&a._listeners.splice(c-deletedEntries,1);for(c=0;c<b.length;c++)b[c].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 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)}};WEB_SOCKET_SWF_LOCATION=TradingView.resourceFullPath("web_socket_main.swf");WEB_SOCKET_WAS_CONNECTED=WEB_SOCKET_DEBUG=!1;STUDY_COUNT_LIMIT=100;function HandlerInfo(a,b){this.handler=a;this.customId=b;this.requestHook=null}function D97(){}D97.prototype.defaultWatchlistSymbols=function(){};D97.prototype.availableTimeFrames=function(a,b){};D97.prototype.defaultResolutions=function(){};D97.prototype.supportedSymbolsTypes=function(){};
|
|
D97.prototype.supportedExchangesList=function(){};D97.prototype.setAuthToken=function(a,b){};D97.prototype.authTokenRequired=function(a){};D97.prototype.quoteCreateSession=function(a){};D97.prototype.quoteDeleteSession=function(a){};D97.prototype.quoteSetFields=function(a,b){};D97.prototype.quoteAddSymbols=function(a,b){};D97.prototype.quoteRemoveSymbols=function(a,b){};
|
|
D97.prototype.quoteFastSymbols=function(a,b){};D97.prototype.depthCreateSession=function(a,b,c){};D97.prototype.depthDeleteSession=function(a){};D97.prototype.depthSetSymbol=function(a,b){};D97.prototype.depthClearSymbol=function(a){};D97.prototype.depthSetScale=function(a,b){};D97.prototype.chartCreateSession=function(a,b){};D97.prototype.chartDeleteSession=function(a){};
|
|
D97.prototype.createSession=function(a,b){};D97.prototype.removeSession=function(a){};D97.prototype.connected=function(){};D97.prototype._getHost=function(a){};D97.prototype.connect=function(){};D97.prototype.disconnect=function(){};D97.prototype.switchTimezone=function(a,b){};D97.prototype.resolveSymbol=function(a,b,c,d,e){};
|
|
D97.prototype.createSeries=function(a,b,c,d,e,f,g){};D97.prototype.removeSeries=function(a,b,c){};D97.prototype.modifySeries=function(a,b,c,d,e,f){};D97.prototype.requestMoreData=function(a,b,c,d){};D97.prototype.requestMetadata=function(a,b,c){};D97.prototype.isCanCreateStudy=function(){};D97.prototype.createStudy=function(a,b,c,d,e,f,g){};D97.prototype.removeStudy=function(a,b,c){};
|
|
D97.prototype.modifyStudy=function(a,b,c,d,e){};D97.prototype.createPointset=function(a,b,c,d,e,f,g){};D97.prototype.modifyPointset=function(a,b,c,d,e){};D97.prototype.removePointset=function(a,b,c){};D97.prototype.requestMoreTickmarks=function(a,b,c,d){};D97.prototype.requestFirstBarTime=function(a,b,c,d){};D97.prototype._invokeHandler=function(a,b){};
|
|
D97.prototype._sendRequest=function(a,b){};D97.prototype._onMessage=function(a){};D97.prototype._convertTimescaleResponse=function(a){};D97.prototype._dispathNotification=function(a){};D97.prototype._invokeNotificationHandler=function(a,b,c){};D97.prototype._notifySessions=function(a){};D97.prototype.unpack=function(a){};D97.prototype.reconnectTimeout=function(a){};
|
|
D97.prototype.searchSymbolsByName=function(a){};D97.prototype._isSafari5=function(){};D97.prototype._isIE9=function(){};D97.prototype._isIOS5=function(){};D97.prototype._getPort=function(a){};D97.prototype.getMarks=function(a,b,c,d,e){};declareClassAsPureInterface(D97,"D97");function ChartSession(a,b){this._chartApi=a;this._sessionid="cs_"+TradingView.randomHash();this._sessionDisabled=!1;this._disableStatistics=!!b}ChartSession.prototype.serverTimeOffset=function(){return this._chartApi._serverTimeOffset};ChartSession.prototype.connected=function(){return this._chartApi.connected()&&!this._sessionDisabled};ChartSession.prototype.disconnected=function(){var a=this;Object.keys(this).forEach(function(b){/^(s|st|symbol_)\d+$/.test(b)&&delete a[b]})};
|
|
ChartSession.prototype.initSession=function(){this._chartApi.createSession(this._sessionid,this)};ChartSession.prototype.stopSession=function(){this._chartApi.removeSession(this._sessionid)};ChartSession.prototype.setHandler=function(a){this._globalHandler=a};ChartSession.prototype.connect=function(a){this._globalHandler=a;this.initSession();this._chartApi.connect()};ChartSession.prototype.disconnect=function(){this._chartApi.disconnect()};
|
|
ChartSession.prototype.switchTimezone=function(a){this._chartApi.switchTimezone(this._sessionid,a)};ChartSession.prototype.resolveSymbol=function(a,b,c){this._chartApi.resolveSymbol(this._sessionid,a,b,c)};ChartSession.prototype.createSeries=function(a,b,c,d,e,f){this._chartApi.createSeries(this._sessionid,a,b,c,d,e,f)};ChartSession.prototype.removeSeries=function(a,b){this._chartApi.removeSeries(this._sessionid,a,b)};
|
|
ChartSession.prototype.modifySeries=function(a,b,c,d,e){this._chartApi.modifySeries(this._sessionid,a,b,c,d,e)};ChartSession.prototype.requestMoreData=function(a,b,c){this._chartApi.requestMoreData(this._sessionid,a,b,c)};ChartSession.prototype.requestMetadata=function(a,b){this._chartApi.requestMetadata(this._sessionid,a,b)};ChartSession.prototype.createStudy=function(a,b,c,d,e,f){this._chartApi.createStudy(this._sessionid,a,b,c,d,e,f)};
|
|
ChartSession.prototype.removeStudy=function(a,b){this._chartApi.removeStudy(this._sessionid,a,b)};ChartSession.prototype.modifyStudy=function(a,b,c,d){this._chartApi.modifyStudy(this._sessionid,a,b,c,d)};ChartSession.prototype.createPointset=function(a,b,c,d,e,f){this._chartApi.createPointset(this._sessionid,a,b,c,d,e,f)};ChartSession.prototype.modifyPointset=function(a,b,c,d){this._chartApi.modifyPointset(this._sessionid,a,b,c,d)};
|
|
ChartSession.prototype.removePointset=function(a,b){this._chartApi.removePointset(this._sessionid,a,b)};ChartSession.prototype.requestMoreTickmarks=function(a,b,c){this._chartApi.requestMoreTickmarks(this._sessionid,a,b,c)};ChartSession.prototype.requestFirstBarTime=function(a,b,c){this._chartApi.requestFirstBarTime(this._sessionid,a,b,c)};
|
|
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)};ChartSession.prototype.disable=function(){this._sessionDisabled=!0};function TimeIndexes(){this._zoffset=0;this._items=[];this._lastTimePointIndex=null}TimeIndexes.prototype.clear=function(){this._zoffset=0;this._items=[];this._lastTimePointIndex=null};TimeIndexes.prototype.items=function(){return this._items};TimeIndexes.prototype.size=function(){return this._items.length};TimeIndexes.prototype.firstTimePointIndex=function(){return this.offsetToIndex(0)};
|
|
TimeIndexes.prototype.lastTimePointIndex=function(){return null!==this._lastTimePointIndex&&void 0!==this._lastTimePointIndex?this._lastTimePointIndex:this._lastTimePointIndex=this.offsetToIndex(this.size()-1)};
|
|
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){d=Math.abs(d);this._items=Array(d).concat(this._items);this._zoffset=b;for(var e=0;e<c.length;++e)this._items[a+e+b]=c[e];return[{change:"rebuild",index:0}]}a=[];for(e=d;e<this._items.length&&e-d<c.length;++e)this._items[e]=c[e-d],a.push({change:"update",index:e-this._zoffset,value:c[e-d]});d+=c.length;if(d>this._items.length)for(d-=
|
|
this._items.length,e=0;e<d;++e){var f=this._items.length;this._items.push(c[e]);a.push({change:"append",index:f-this._zoffset,value:c[e]})}this._zoffset=b;this._lastTimePointIndex=null;return a};TimeIndexes.prototype.addTail=function(a,b){for(var c=b?1:0;c<a.length;c++)this._items.push(a[c]),this._lastTimePointIndex++};TimeIndexes.prototype.valueAt=function(a){a=this.indexToOffset(a);if(void 0!==a)return this._items[a]};
|
|
TimeIndexes.prototype.indexOf=function(a,b){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};TimeIndexes.prototype.offsetToIndex=function(a){if(0<=a&&a<this.size())return a-this._zoffset};TimeIndexes.prototype.indexToOffset=function(a){a+=this._zoffset;if(0<=a&&a<this.size())return a};TimeIndexes.prototype.state=function(){var a={};a.zoffset=this._zoffset;a.items=this._items;return a};
|
|
TimeIndexes.prototype.restoreState=function(a){a&&(this._zoffset=a.zoffset,this._items=a.items,this._lastTimePointIndex=null)};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}}};function PlotList(a){this._items=[];this._columns=a?a:[];this._end=this._start=0;this._shareread=!1}PlotList.prototype.clear=function(){this._items=[];this._columns=[];this._end=this._start=0;this._shareread=!1};PlotList.prototype.columns=function(){return this._columns};PlotList.prototype.last=function(){return this._items[this._end-this._start-1]};PlotList.prototype.first=function(){return this._items[0]};PlotList.prototype.firstIndex=function(){return this._start};
|
|
PlotList.prototype.lastIndex=function(){return this._end-this._start-1};PlotList.prototype.size=function(){return this._end-this._start};PlotList.prototype.isEmpty=function(){return 0===this.size()};PlotList.prototype.contains=function(a){return-1!=this._search(a)};PlotList.prototype.valueAt=function(a){if(a=this.search(a))return a.value};
|
|
PlotList.prototype.add=function(a,b){if(this._shareread)return TradingView.logDebug("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};var SEARCH_NEAREST_LEFT=-1,SEARCH_EXACT=0,SEARCH_NEAREST_RIGHT=1;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)}};
|
|
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};PlotList.prototype.each=function(a){for(var b=this._start;b<this._end&&!a(this._indexAt(b),this._valueAt(b));++b);};PlotList.prototype.range=function(a,b){var c=new PlotList;c._items=this._items;c._start=this._lowerbound(a);c._end=Math.min(this._lowerbound(b)+1,c._items.length);c._items[c._end-1]>b&&(c._end=c._start);c._shareread=!0;return c};
|
|
PlotList.prototype.merge=function(a){if(this._shareread)return TradingView.logDebug("PlotList.merge: shared collection modification attempt"),[];for(var b=[],c=0;c<a.length;++c){var d=a[c];this.add(d.index,d.value)?b.push({insert:d}):b.push({update:d})}return b};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)}};
|
|
PlotList.prototype._createPair=function(a,b){var c=new Number(a);c.value=b;return c};PlotList.prototype._valueAt=function(a){return this._items[a].value};PlotList.prototype._length=function(a){return this._items.length};PlotList.prototype._indexAt=function(a){return this._items[a].valueOf()};
|
|
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-=1),c!=this._end&&this._indexAt(c)<a?c:-1;c=this._upperbound(a);return c!=this._end&&a<this._indexAt(c)?c:-1};PlotList.prototype._bsearch=function(a){var b=this._lowerbound(a);return b==this._end||a<this._items[b]?-1:b};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};
|
|
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};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};
|
|
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()};PlotList.prototype.firstTimeIndex=function(){return this._indexAt(this._start)};PlotList.prototype.lastTimeIndex=function(){return this._indexAt(this._end-1)};function StudyMetaInfo(a){TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}});TradingView.merge(this,a);TradingView.merge(this,StudyMetaInfo.parseIdString(a.id));this.name=this.id}StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION=27;StudyMetaInfo.FilledArea={};StudyMetaInfo.FilledArea.TYPE_PLOTS="plot_plot";StudyMetaInfo.FilledArea.TYPE_HLINES="hline_hline";
|
|
StudyMetaInfo.versionOf=function(a){a="_metainfoVersion"in a&&isNumber(a._metainfoVersion)?a._metainfoVersion:0;(0>a||a>StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION)&&console.warn("Client doesn't support this version of metainfo format: "+a);return a};
|
|
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};StudyMetaInfo.getPackageName=function(a){return(/^[^@]+@([^-]+-[^-]+)/.exec(a||"")||[0,"tv-basicstudies"])[1]};StudyMetaInfo.cutFullId=function(a){return a.replace(/(@[^-]+-[^-]+).*$/,"$1")};
|
|
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};StudyMetaInfo.prototype.parseValue=function(a,b){return"bool"===a?parseBool(b):b};StudyMetaInfo.prototype.defaultInputs=function(){for(var a=new List,b=0;b<this.inputs.length;b++)a.append(this.inputs[b].defval);return a};
|
|
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};StudyMetaInfo.findStudyMetaInfoByDescription=function(a,b){if(a){for(var c=0;c<a.size();++c)if(a.item(c).description===b)return a.item(c);throw Error("unexpected study id:"+b);}throw Error("There is no studies metainfo");};
|
|
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");};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");};
|
|
StudyMetaInfo.addStudyMetaInfo=function(a,b){var c=new StudyMetaInfo(b);assert(!1===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};
|
|
StudyMetaInfo.addOrReplaceStudyMetaInfo=function(a,b){var c=new StudyMetaInfo(b);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};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})};
|
|
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};
|
|
StudyMetaInfo.createMetaInfoStub=function(a,b){var c=a.scriptIdPart||TVScript.MetainfoGenerator.createScriptIdPart();return{id:TVScript.MetainfoGenerator.createScriptStudyId(a.scriptIdPart,b),scriptIdPart:a.scriptIdPart,description:a.scriptName,TVScriptSourceCode:a.scriptSource,version:b,_buildFullMetaInfo:function(){return(new TVScript.TvsTranslator).translate(a.scriptSource,!0,null,c,b).metaInfo}}};
|
|
StudyMetaInfo.replaceWithFullStudyMetaInfo=function(a,b){if(b._buildFullMetaInfo){try{var c=b._buildFullMetaInfo()}catch(d){c=Q57.createScriptStub(b.TVScriptSourceCode,b.scriptIdPart,b.version)}return StudyMetaInfo.addOrReplaceStudyMetaInfo(a,c)}return b};"undefined"!=typeof module&&module&&module.exports&&(module.exports=StudyMetaInfo);StudyMetaInfo.getOrderedInputIds=function(a){var b=[];a=a.inputs;for(var c=0;c<a.length;++c)b.push(a[c].id);return b};TradingView.drawingState=function(){function a(a){return"cursor"===a||"arrow"===a||"dot"===a}var b=null,c=null,d=null,e=new WatchedValue,f=new WatchedValue,g=!1;return{tool:e,cursorTool:f,toolIsCursor:a,resetToCursor:function(a){!a&&b&&b.stayInDrawingMode.value()||this.tool.setValue(this.cursorTool.value())},init:function(){g||(e.setValue(TVSettings.getValue("chart.cursorPreference","cursor")),e.subscribe(function(b){a(b)&&f.setValue(b)},{callWithLast:!0}),f.subscribe(function(a){a&&TVSettings.setValue("chart.cursorPreference",
|
|
a)}),b=new W51("drawings"),c=new Property,d=new Property,c.setValue(!1),d.setValue(!1),g=!0)},properties:function(){return b},hideAllDrawings:function(){return c},lockDrawings:function(){return d}}}();function HitTestResult(a,b,c){this._result=a;this._data=b;this._eraseMarker=c}HitTestResult.REGULAR=1;HitTestResult.MOVEPOINT=2;HitTestResult.CHANGEPOINT=3;HitTestResult.CUSTOM=4;HitTestResult.prototype.result=function(){return this._result};HitTestResult.prototype.data=function(){return this._data};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}DataSource.prototype.id=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.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.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()};function PriceDataSource(){DataSource.call(this);this._isOverlay=null}inherit(PriceDataSource,DataSource);PriceDataSource.prototype.isNoScale=function(){return!!this._isOverlay};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(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 TypeValidator(String)).check(a)||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.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)};
|
|
function W51(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,W51.prototype.onPropertyChanged);this._exclusions=[]}inherit(W51,Property);W51._saveDefaults=!1;TradingView.saveDefaultProperties=function(a){W51._saveDefaults=a};W51.prototype.addExclusion=function(a){this._exclusions.push(a)};
|
|
W51.prototype.restoreFactoryDefaults=function(){var a={};this._defaultName.startsWith("study_")&&(a=TradingView.clone(factoryDefaults("study")));var b=TradingView.clone(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;TradingView.merge(a,b);this.merge(a);saveDefaults(this._defaultName,this.state(this._exclusions));this.listeners().fire(this)};W51.prototype.cleanupFactoryDefaults=function(){saveDefaults(this._defaultName,{});this.listeners().fire(this)};W51.prototype.onPropertyChanged=function(){W51._saveDefaults&&this.saveDefaults()};W51.prototype.saveDefaults=function(){saveDefaults(this._defaultName,this.state(this._exclusions))};function factoryDefaults(a){"undefined"==typeof defaultProperties&&(defaultProperties={chartproperties:{timezone:"UTC",timeScale:{barSpacing:DEFAULT_BAR_SPACING,rightOffset:DEFAULT_RIGHT_OFFSET},dataWindowProperties:{background:"#FFFECE",border:"#606090",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{background:"#ffffff",gridProperties:{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,showSymbolLabels:!1},rightAxisProperties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,showSymbolLabels:!1},overlayPropreties:{autoScale:!0,autoScaleDisabled:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,showSymbolLabels:!1}},scalesProperties:{showLeftScale:!1,showRightScale:!0,
|
|
backgroundColor:"#ffffff",lineColor:"#555",textColor:"#555",scaleSeriesOnly:!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,showLastValue:!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",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375"},haStyle:{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:"#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:0,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}}},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"]},drawings:{magnet:!1,stayInDrawingMode:!1,crossHairColor:"#B7B7B7",crossHairStyle:CanvasEx.LINESTYLE_DASHED,crossHairWidth:1},linetoolorder:{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},linetoolposition:{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},linetoolexecution:{direction:"buy",arrowHeight:8,arrowSpacing:1,arrowColor:"#00F",arrowTransparency:0,text:"execution",textColor:"#000",textTransparency:0,fontFamily:"Verdana",fontSize:8,fontBold:!1,fontItalic:!1},linetoolicon:{clonable:!0,color:"#3D85C6",snapTo45Degrees:!0,size:40,icon:9786,angle:0.5*
|
|
Math.PI,scale:1},linetooltrendline:{clonable:!0,linecolor:"#159980",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:D46.LINEEND_NORMAL,rightEnd:D46.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},linetooltrendangle:{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:D46.LINEEND_NORMAL,rightEnd:D46.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:D46.LINEEND_NORMAL,rightEnd:D46.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:"#585858",labelBackgroundTransparency:0,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:"#585858",labelBackgroundTransparency:0,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:D46.LINEEND_NORMAL,rightEnd:D46.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:D46.LINEEND_NORMAL,rightEnd:D46.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:D46.LINEEND_NORMAL,rightEnd:D46.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:{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},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:{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:{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},linetoolelliottsubminuette:{clonable:!0,showWave:!0,color:"#3d85c6",wavesize:0,showBackground:!0},linetoolelliottminor:{clonable:!0,showWave:!0,color:"#ff9800",wavesize:3,showBackground:!0},linetoolelliottcircle:{clonable:!0,showWave:!0,color:"#6aa84f",wavesize:6,showBackground:!0},linetoolelliottminorretr:{clonable:!0,
|
|
showWave:!0,color:"#a64d79",wavesize:0,showBackground:!0},linetoolelliottmajorretr:{clonable:!0,showWave:!0,color:"#bf9000",wavesize:1,showBackground:!0},linetoolbarspattern:{color:"#5091CC",clonable:!0,mode:TradingView.LineToolBarsPattern.BARS_MODE,mirrored:!1,flipped:!1},study:{inputs:{},styles:{},palettes:{},bands:{},area:{},graphics:{},showInDataWindow:!0,showLastValue:!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:0.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.618},level4:{visible:!1,color:"#006599",linewidth:1,
|
|
linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.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:0.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:0.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:0.25,visible:!0},hlevel3:{color:"#699E00",coeff:0.382,visible:!0},hlevel4:{color:"#009B00",coeff:0.5,visible:!0},hlevel5:{color:"#009965",coeff:0.618,visible:!0},hlevel6:{color:"#006599",coeff:0.75,visible:!0},hlevel7:{color:"#808080",coeff:1,visible:!0},vlevel1:{color:"#808080",coeff:0,visible:!0},vlevel2:{color:"#A06B00",coeff:0.25,visible:!0},vlevel3:{color:"#699E00",coeff:0.382,visible:!0},vlevel4:{color:"#009B00",coeff:0.5,visible:!0},vlevel5:{color:"#009965",
|
|
coeff:0.618,visible:!0},vlevel6:{color:"#006599",coeff:0.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:0.25,visible:!0},hlevel3:{color:"#699E00",coeff:0.382,visible:!0},hlevel4:{color:"#009B00",coeff:0.5,visible:!0},hlevel5:{color:"#009965",coeff:0.618,visible:!0},hlevel6:{color:"#006599",coeff:0.75,visible:!0},hlevel7:{color:"#808080",coeff:1,visible:!0},vlevel1:{color:"#808080",coeff:0,visible:!0},vlevel2:{color:"#A06B00",coeff:0.25,visible:!0},vlevel3:{color:"#699E00",coeff:0.382,visible:!0},vlevel4:{color:"#009B00",coeff:0.5,visible:!0},vlevel5:{color:"#009965",coeff:0.618,visible:!0},vlevel6:{color:"#006599",
|
|
coeff:0.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},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:0.236},level3:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level4:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level5:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.618},level6:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.764},level7:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:1},level8:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level9:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level10:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236}},linetoolfibchannel:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,
|
|
extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,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:0.236},level3:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level4:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level5:{visible:!0,
|
|
color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.618},level6:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.764},level7:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level8:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level9:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:2.618},level10:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:3.618},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236}},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:{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:0.236},level2:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level3:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level4:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.618},level5:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.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:0.236},level2:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level3:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level4:{visible:!0,color:"#28CC95",linewidth:1,
|
|
linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.618},level5:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.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,trendline:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.236},level2:{visible:!0,
|
|
color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level3:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level4:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.618},level5:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.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},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:0.236},level3:{visible:!0,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level4:{visible:!0,color:"#28CC28",
|
|
linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level5:{visible:!0,color:"#28CC95",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.618},level6:{visible:!0,color:"#2895CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.764},level7:{visible:!0,color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1},level8:{visible:!0,color:"#2828CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:1.618},level9:{visible:!0,color:"#CC2828",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:2.618},level10:{visible:!0,color:"#9528CC",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:3.618},level11:{visible:!0,color:"#CC2895",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:4.236}},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:0.382},level3:{visible:!1,color:"#95CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level4:{visible:!0,color:"#28CC28",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.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:0.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.618},
|
|
level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.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:0.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:0.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.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:0.25},level1:{visible:!1,color:"#699E00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.382},level2:{visible:!0,color:"#009B00",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.5},level3:{visible:!1,color:"#009965",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
coeff:0.618},level4:{visible:!1,color:"#006599",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,coeff:0.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(defaultProperties.chartproperties));"undefined"==typeof defaultProperties["study_MA@tv-basicstudies"]&&(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.Study.PLOT_LINE,histogramBase:0,title:"MA"}}});"undefined"==typeof defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]&&(defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]=
|
|
{description:"Error On Update",styles:{ErrorOnUpdate:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.Study.PLOT_LINE,histogramBase:0}}});"undefined"==typeof defaultProperties["study_ErrorOnCreate@tv-basicstudies"]&&(defaultProperties["study_ErrorOnCreate@tv-basicstudies"]={description:"Error On Create",styles:{ErrorOnUpdate:{visible:!0,color:"#00ff00",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.Study.PLOT_LINE,histogramBase:0}}});
|
|
"undefined"==typeof defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]&&(defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]={description:"Error On New Bar",styles:{ErrorOnUpdate:{visible:!0,color:"#0000ff",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.Study.PLOT_LINE,histogramBase:0}}});"undefined"==typeof defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={font:"Arial",fontsize:10,borderColor:"#538F1F",
|
|
backColor:"#F0FFCC",textColor:"#000000"});"undefined"==typeof defaultProperties["study_PivotPointsStandard@tv-basicstudies"]&&(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 defaultProperties["study_ZigZag@tv-basicstudies"]&&(defaultProperties["study_ZigZag@tv-basicstudies"]={color:"#56871D",linewidth:2});"undefined"==typeof defaultProperties["study_ElliottWave@tv-basicstudies"]&&(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 defaultProperties["study_LinearRegression@tv-basicstudies"]&&(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 defaultProperties["study_RegressionTrend@tv-basicstudies"]&&(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 defaultProperties["study_Compare@tv-basicstudies"]&&(defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"});"undefined"==typeof defaultProperties["study_Overlay@tv-basicstudies"]&&(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.Study.PLOT_LINE,histogramBase:0,title:"open"},high:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.Study.PLOT_LINE,histogramBase:0,title:"high"},low:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
linewidth:1,plottype:TradingView.Study.PLOT_LINE,histogramBase:0,title:"low"},close:{visible:!0,color:"#ff0000",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:TradingView.Study.PLOT_LINE,histogramBase:0,title:"close"}}});a=a.split(".");for(var b=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].serValue?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=factoryDefaults(a);window._UNIT_TESTS||(a=TradingView.clone(TVSettings.getJSON(a,null)),TradingView.merge(b,a));return b}function _defaultsUpdated(a,b){var c=factoryDefaults(a);if(!window._UNIT_TESTS){var d=TradingView.clone(TVSettings.getJSON(a,null));a.startsWith("study_")&&d&&Q0.isVersionHead(d.version)&&(d=b.updateStudyState(d,d));TradingView.merge(c,d)}return c}
|
|
function saveDefaults(a,b){TVSettings.setJSON(a,b)}defaults.create=function(a,b){if(b){var c=StudyMetaInfo.parseIdString(a),d=factoryDefaults(c.id);defaultProperties[c.id]=$.extend(b,d)}};defaults.createOrReplace=function(a,b){if(b){var c=StudyMetaInfo.parseIdString(a);defaultProperties[c.id]=b}};defaults.remove=function(a){defaultProperties[a]=void 0};function PriceFormatter(a,b,c,d){b||(b=1);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.logDebug("invalid minmove2"):(this._fractional=c,this.calculateDecimal())}PriceFormatter.prototype.isFractional=function(){return this._fractional};PriceFormatter.prototype.decimalSign=".";PriceFormatter.prototype.decimalSignFractional="'";PriceFormatter.prototype.southandDelimeter="`";
|
|
PriceFormatter.prototype.fullPrecision=!1;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++}};
|
|
function numberToStringWithLeadingZero(a,b){if(!isNumber(a))return"n/a";if(!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)}PriceFormatter.prototype.format=function(a,b){var c="";0>a?(c=!0===b?"\u2212":"-",a=-a):a&&!0===b&&(c="+");return this._fractional?c+this.formatAsFractional(a):c+this.formatAsDecimal(a)};
|
|
PriceFormatter.prototype.formatAsDecimal=function(a){var b;b=this._fractional?Math.pow(10,this._fractionalLength||0):this._priceScale/this._minMove;var c=Math.floor(a);a=Math.round(a*b)-c*b;a===b&&(a=0,c+=1);b=1>=b?"":this.decimalSign+numberToStringWithLeadingZero(a*this._minMove,this._fractionalLength);return c.toString()+b};
|
|
PriceFormatter.prototype.formatAsFractional=function(a){var b=this._priceScale/this._minMove,c=Math.floor(a);a=Math.round(a*b)-c*b;a===b&&(a=0,c+=1);if(this._minMove2){var b=["0","5"],d=["0","2","5","7"],e=a%this._minMove2;a=(a-e)/this._minMove2;a=numberToStringWithLeadingZero(a,this._fractionalLength)+this.decimalSignFractional+(2===this._minMove2?b[e]:d[e])}else a=numberToStringWithLeadingZero(a*this._minMove,this._fractionalLength);return c.toString()+this.decimalSignFractional+a};
|
|
function PercentageFormatter(){PriceFormatter.call(this,100)}inherit(PercentageFormatter,PriceFormatter);PercentageFormatter.prototype.format=function(a,b){return PriceFormatter.prototype.format.call(this,a,b)+"%"};function DateFormatter(){}DateFormatter.prototype.format=function(a){return numberToStringWithLeadingZero(a.getUTCFullYear(),4)+"-"+numberToStringWithLeadingZero(a.getUTCMonth()+1,2)+"-"+numberToStringWithLeadingZero(a.getUTCDate(),2)};
|
|
function TimeFormatter(a){this._format_str=a||"%h:%m:%s"}TimeFormatter.prototype.format=function(a){return this._format_str.replace("%h",numberToStringWithLeadingZero(a.getUTCHours(),2)).replace("%m",numberToStringWithLeadingZero(a.getUTCMinutes(),2)).replace("%s",numberToStringWithLeadingZero(a.getUTCSeconds(),2))};function DateTimeFormatter(a){this._dwm=a}DateTimeFormatter.prototype.format=function(a){var b=(new DateFormatter).format(a);this._dwm||(b+=" "+(new TimeFormatter).format(a));return b};
|
|
function VolumeFormatter(a){this._precision=a;this._fractionalValues=0<a}
|
|
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"};function TimeSpanFormatter(){}
|
|
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()};function PriceColorer(){this._prev=null}
|
|
PriceColorer.formatSign=function(a){return 0==a?"#5A5D66":0<a?"#27AC66":"#DA563E"};PriceColorer.formatDiff=function(a,b){PriceColorer.signFormat(b-a)};PriceColorer.prototype.format=function(a){try{return null===this._prev?PriceColorer.formatSign(a):PriceColorer.formatDiff(this._prev,a)}finally{this._prev=a}};function AbstractBarColorer(){this.backColorers=[]}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};AbstractBarColorer.prototype.pushBackBarColorer=function(a){this.backColorers.push(a)};AbstractBarColorer.prototype.applyBarStyle=function(a,b,c){throw Error("This function is supposed to be reimplemented in a subclass");};
|
|
function SeriesBarColorer(a){AbstractBarColorer.call(this);this._series=a}inherit(SeriesBarColorer,AbstractBarColorer);
|
|
SeriesBarColorer.prototype.applyBarStyle=function(a,b,c,d){c||(c={});c.barColor=null;c.barBorderColor=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[CLOSE_PLOT]<=l[CLOSE_PLOT]?f:g,c.barBorderColor=b[CLOSE_PLOT]<=l[CLOSE_PLOT]?h:k):(c.barColor=l[OPEN_PLOT]<=l[CLOSE_PLOT]?f:g,c.barBorderColor=l[OPEN_PLOT]<=l[CLOSE_PLOT]?h:k);break;case TradingView.Series.STYLE_CANDLES: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();l=this.findBar(a,!1,d);e.candleStyle.barColorsOnPrevClose.value()?(b=this.findPrevBar(a,!1,d),c.barColor=b[CLOSE_PLOT]<=l[CLOSE_PLOT]?f:g,c.barBorderColor=b[CLOSE_PLOT]<=l[CLOSE_PLOT]?h:k):(c.barColor=l[OPEN_PLOT]<=l[CLOSE_PLOT]?f:g,c.barBorderColor=l[OPEN_PLOT]<=l[CLOSE_PLOT]?h:k);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();l=this.findBar(a,!1,d);b=this.findPrevBar(a,!1,d);b[CLOSE_PLOT]<=l[CLOSE_PLOT]?(c.barColor=f,c.barBorderColor=h):(c.barColor=g,c.barBorderColor=k);c.isBarHollow=l[OPEN_PLOT]<=l[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();l=this.findBar(a,b,d);e.haStyle.barColorsOnPrevClose.value()?(b=this.findPrevBar(a,b,d),c.barColor=b[CLOSE_PLOT]<=l[CLOSE_PLOT]?f:g,c.barBorderColor=b[CLOSE_PLOT]<=l[CLOSE_PLOT]?h:k):(c.barColor=l[OPEN_PLOT]<=l[CLOSE_PLOT]?f:g,c.barBorderColor=l[OPEN_PLOT]<=l[CLOSE_PLOT]?h:k);break;case TradingView.Series.STYLE_RENKO:l=this.findBar(a,b,d);l=l[OPEN_PLOT]<=l[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[OPEN_PLOT]<=l[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[LOW_PLOT]<l[ADT_PLOT]&&l[ADT_PLOT]<l[HIGH_PLOT]?(f=l[OPEN_PLOT]<=
|
|
l[CLOSE_PLOT],c.isTwoColorBar=!0):(f=l[OPEN_PLOT]<=l[CLOSE_PLOT]?l[OPEN_PLOT]==l[ADT_PLOT]?!0:!1:l[OPEN_PLOT]==l[ADT_PLOT]?!1:!0,c.isTwoColorBar=!1);c.barColor=f?c.upColor:c.downColor;c.isBarUp=l[OPEN_PLOT]<=l[CLOSE_PLOT];break;case TradingView.Series.STYLE_PNF:l=this.findBar(a,b,d),l=0<l[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};
|
|
SeriesBarColorer.prototype.getSeriesBars=function(a){return a?this._series.nsBars():this._series.bars()};SeriesBarColorer.prototype._findBarFieldValue=function(a,b,c){a=this.getSeriesBars(c).valueAt(a);if(void 0!==a)return a[b]};SeriesBarColorer.prototype.findBar=function(a,b,c){return c?c.value:this.getSeriesBars(b).valueAt(a)||[]};
|
|
SeriesBarColorer.prototype.findPrevBar=function(a,b,c){if(c)return c.previousValue||[];a=this._series.bars()._search(a,SEARCH_EXACT);return 0<a?this._series.bars()._valueAt(a-1):[]};function StudyBarColorer(a,b){AbstractBarColorer.call(this);this.Z0=a;this._plotIndex=b}inherit(StudyBarColorer,AbstractBarColorer);
|
|
StudyBarColorer.prototype.applyBarStyle=function(a,b,c){c||(c={});if(b)return c;b=this.Z0.properties();if(!b.visible.value())return c;var d=this.Z0.metaInfo(),e=this.Z0.data();if(!e||0==e.size())return c;var f=this.Z0.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);b=b.palettes[d.plots[this._plotIndex].palette].colors[a].color.value();c.barColor=b;c.upColor=b.color;c.downColor=b.color;return c};function BarItem(){this.close=this.low=this.high=this.open=this.time=0}BarItem.prototype.setTime=function(a){isNumber(a)?this.time=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect time")};BarItem.prototype.setOpen=function(a){isNumber(a)?this.open=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect open")};BarItem.prototype.setHigh=function(a){isNumber(a)?this.high=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect high")};
|
|
BarItem.prototype.setLow=function(a){isNumber(a)?this.low=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect low")};BarItem.prototype.setClose=function(a){isNumber(a)?this.close=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect close")};BarItem.prototype.setAdditionalPrice=function(a){isNumber(a)?this.additionalPrice=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect additionalPrice")};BarItem.prototype.setAdditionalNum=function(a){isNumber(a)?this.additionalNum=a:TradingView.logDebug("BarItem.setAdditionalNum: incorrect additionalNum")};function BarsRange(a,b){null===a||isInteger(a)?null===b||isInteger(b)?(this.m_firstBar=a,this.m_lastBar=b):TradingView.logDebug("BarsRange: incorrect lastBar"):TradingView.logDebug("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){!isInteger(a)||0>a?TradingView.logDebug("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.logDebug("BarsRange.shift: incorrect coeff")};
|
|
BarsRange.prototype.contains=function(a){return this.m_firstBar<=a&&this.m_lastBar>=a};Q47=function(a,b,c){this._magnetProperty=a;this._timeScale=b};
|
|
Q47.prototype.align=function(a,b,c){var d=c.defaultPriceScale(),e=d.priceToCoordinate(a);if(!this._magnetProperty.value())return a;d=d.Z18();c=null;for(var f=0;f<d.size();f++)if(d.item(f)instanceof TradingView.Series){c=d.item(f);break}if(c&&(d=c.bars(),d.contains(b)&&(b=d.valueAt(b),b=[b[OPEN_PLOT],b[HIGH_PLOT],b[LOW_PLOT],b[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};Q77=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 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()}}}();Q77.setChartLayout=function(a,b){if(a.layout.value()===b)return!1;var c=new SetChartLayoutCommand(a,b);c.redo();this.pushUndoCommand(c)};
|
|
function SetChartLayoutCommand(a,b){UndoCommand.call(this,"Change Chart Layout to "+Q8.LayoutTemplates[b].title);this.Z4=a;this._newLayoutId=b;this._oldLayoutId=a.layout.value()}inherit(SetChartLayoutCommand,UndoCommand);SetChartLayoutCommand.prototype.redo=function(){this.Z4.layout.setValue(this._newLayoutId)};SetChartLayoutCommand.prototype.undo=function(){this.Z4.layout.setValue(this._oldLayoutId)};
|
|
function D77(a,b,c,d,e,f,g,h){this.Z3=h;this.m_model=new D78(a,b,c,d,e,f,g,this);this.m_undoStack=new UndoStack;this.m_redoStack=new UndoStack;this.m_zoomStack=new UndoStack;this._onSimpleZoomIn=new Delegate;this._onSimpleZoomOut=new Delegate}inherit(D77,EventEmitter);D77.prototype.version=function(){return this.m_model._version};
|
|
D77.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)}};D77.prototype.paneForSource=function(a){return this.m_model.paneForSource(a)};D77.prototype.createPane=function(a){return this.m_model.createPane(a)};D77.prototype.dumpViews=function(){return this.m_model.dumpViews()};D77.prototype.readOnly=function(){return this.m_model.readOnly()};
|
|
D77.prototype.restart=function(){this.m_model.restart()};D77.prototype.disconnect=function(){this.m_model.disconnect()};D77.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()};D77.prototype.studyVersioning=function(){return this.m_model.studyVersioning()};D77.prototype.chartModel=function(){return this.m_model};D77.prototype.undoStack=Q77.undoStack;D77.prototype.redoStack=Q77.redoStack;
|
|
D77.prototype.undo=Q77.undo;D77.prototype.redo=Q77.redo;D77.prototype.pushUndoCommand=Q77.pushUndoCommand;D77.prototype.startScalePrice=function(a,b,c){this.pushUndoCommand(new D88(this.m_model,a,b,b.state()));this.chartModel().startScalePrice(a,b,c)};D77.prototype.scalePriceTo=function(a,b,c){this.chartModel().scalePriceTo(a,b,c)};
|
|
D77.prototype.endScalePrice=function(a,b){this.chartModel().endScalePrice(a,b)};D77.prototype.startScrollPrice=function(a,b,c){b.isAutoScale()||(this._initialPriceScrollState=b.state(),this._initialPriceScrollPos=c,this.chartModel().startScrollPrice(a,b,c))};
|
|
D77.prototype.scrollPriceTo=function(a,b,c){b.isAutoScale()||(this._initialPriceScrollPos&&20<Math.abs(this._initialPriceScrollPos-c)&&(this.pushUndoCommand(new D88(this.m_model,a,b,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(a,b,c))};
|
|
D77.prototype.endScrollPrice=function(a,b){b.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(a,b))};D77.prototype.setPriceAutoScale=function(a,b,c){this.pushUndoCommand(new D88(this.m_model,a,b,b.state()));this.chartModel().setPriceAutoScale(a,b,c)};
|
|
D77.prototype.resetPriceScale=function(a,b){this.pushUndoCommand(new D88(this.m_model,a,b,b.state()));this.chartModel().resetPriceScale(a,b)};D77.prototype.startScaleTime=function(a){this.pushUndoCommand(new D93(this.m_model,this.m_model.timeScale().state(),"scale time"));this.chartModel().startScaleTime(a)};D77.prototype.scaleTimeTo=function(a){this.chartModel().scaleTimeTo(a)};D77.prototype.endScaleTime=function(){this.chartModel().endScaleTime()};
|
|
D77.prototype.startScrollTime=function(a){this._initialTimeScrollState=this.m_model.timeScale().state();this._initialTimeScrollPos=a;this.chartModel().startScrollTime(a)};D77.prototype.scrollTimeTo=function(a){this._initialTimeScrollPos&&20<Math.abs(a-this._initialTimeScrollPos)&&(this.pushUndoCommand(new D93(this.m_model,this._initialTimeScrollState,"scroll time")),delete this._initialTimeScrollPos,delete this._initialTimeScrollState);this.chartModel().scrollTimeTo(a)};
|
|
D77.prototype.endScrollTime=function(){this.chartModel().endScrollTime();delete this._initialTimeScrollPos;delete this._initialTimeScrollState};D77.prototype.resetTimeScale=function(){this.pushUndoCommand(new D93(this.m_model,this.m_model.timeScale().state()));this.chartModel().resetTimeScale()};D77.prototype.canZoomIn=function(){return this.chartModel().canZoomIn()};D77.prototype.canZoomOut=function(){return this.chartModel().canZoomOut()};
|
|
D77.prototype.setWidth=function(a){this.m_model.setWidth(a)};D77.prototype.setPaneHeight=function(a,b){this.m_model.setPaneHeight(a,b)};D77.prototype.gridSource=function(){return this.m_model.gridSource()};D77.prototype.watermarkSource=function(){return this.m_model.watermarkSource()};D77.prototype.addAlertsSource=function(a){return this.m_model.addAlertsSource(a)};D77.prototype.alertsSources=function(){return this.m_model.alertsSources()};
|
|
D77.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()};D77.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()};D77.prototype.crossHairSource=function(){return this.m_model.crossHairSource()};D77.prototype.model=function(){return this.m_model};D77.prototype.mainSeries=function(){return this.m_model.m_mainSeries};D77.prototype.panes=function(){return this.m_model.m_panes};
|
|
D77.prototype.timeScale=function(){return this.m_model.timeScale()};D77.prototype.setSelectedSource=function(a,b){this.m_model.setSelectedSource(a,b)};D77.prototype.setHoveredSource=function(a,b){this.m_model.setHoveredSource(a,b)};D77.prototype.selectedSource=function(){return this.m_model.selectedSource()};D77.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()};D77.prototype.hoveredSource=function(){return this.m_model.hoveredSource()};
|
|
D77.prototype.Z19=function(a){this.m_model.Z19(a)};D77.prototype.setCurrentPosition=function(a,b,c,d){this.m_model.setCurrentPosition(a,b,c,d)};D77.prototype.modifySeries=function(a,b,c){a=new D85(this.m_model,a,b,c);this.pushUndoCommand(a);a.redo()};
|
|
D77.prototype.insertStudy=function(a,b,c){if(this.model()._chartApi._chartApi.isCanCreateStudy())return a=new InsertStudyCommand(this.m_model,a,b,c),this.pushUndoCommand(a),a.redo();Q83.showNotice("Error","Exceeded the limit of studies")};D77.prototype.setProperty=function(a,b,c){a&&a.value()!==b&&(a=new SetPropertyCommand(a,b,c,this.m_model),this.pushUndoCommand(a),a.redo(),this.emitEvent("setProperty"))};
|
|
D77.prototype.setPercentProperty=function(a,b,c,d){a.value()!==b&&(a=new SetPercentagePropertyCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};D77.prototype.setLogProperty=function(a,b,c,d){a.value()!==b&&(a=new SetLogPropertyCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};D77.prototype.setAutoScaleProperty=function(a,b,c,d){a.value()!==b&&(a=new SetAutoScalePropertyCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};
|
|
D77.prototype.setChartStyleProperty=function(a,b,c){a.value()!==b&&(a=new SetChartStyleCommand(a,b,this.mainSeries(),c,this.m_model,this.Z3),this.pushUndoCommand(a),a.redo(),this.emitEvent("setChartStyleProperty"))};D77.prototype.setLockScaleProperty=function(a,b,c,d){a.value()!==b&&(a=new SetLockScaleCommand(a,b,c,d,this.m_model),this.pushUndoCommand(a),a.redo())};
|
|
D77.prototype.setScreenChartProperty=function(a,b,c,d,e){if(e||a.value()!==b)a=new D91(d,a,b,c,e),this.pushUndoCommand(a),a.redo()};D77.prototype.beginUndoMacro=Q77.beginUndoMacro;D77.prototype.endUndoMacro=Q77.endUndoMacro;D77.prototype.createUndoCheckpoint=Q77.createUndoCheckpoint;D77.prototype.undoToCheckpoint=Q77.undoToCheckpoint;
|
|
D77.prototype.removeSource=function(a){if(a.isUserDeletable()){var b=new RemoveSourceCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("removeSource",[a])}};D77.prototype.removeSelectedSource=function(){var a=this.m_model.selectedSource();if(a&&a.isUserDeletable()){this.setSelectedSource(null);var b=new RemoveSourceCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("removeSource",[a])}};
|
|
D77.prototype.move=function(a,b,c){var d=this.m_model.paneForSource(a);b=new D87(this.m_model,a,d,b,c);this.pushUndoCommand(b);b.redo();this.emitEvent("moveSource",[a])};
|
|
D77.prototype.createLineTool=function(a,b,c,d){if("LineToolRegressionTrend"!=c||this.model()._chartApi._chartApi.isCanCreateStudy())return c=this.m_model.createLineTool(a,b,c,d),this._createLineCommand=new D82(this.m_model,c,a,b),this.m_model.lineBeingCreated()||(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),c;Q83.showNotice("Error","Exceeded the limit of studies")};D77.prototype.lineBeingCreated=function(){return this.m_model.lineBeingCreated()};
|
|
D77.prototype.paneBeingCreatedLineOn=function(){return this.m_model.paneBeingCreatedLineOn()};D77.prototype.coninueCreatingLine=function(a,b){this.m_model.lineBeingCreated();this.m_model.paneBeingCreatedLineOn();var c=this.m_model.coninueCreatingLine(a,b);this._createLineCommand.coninueCreatingLine(a,b);c&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand);return c};D77.prototype.cancelCreatingLine=function(){this.m_model.cancelCreatingLine()};
|
|
D77.prototype.lineCancelled=function(){return this.m_model.lineCancelled()};D77.prototype.startChangingLinetool=function(a,b,c,d){this._currentLineChangeCommand=new D79(this.m_model,a,c,d);this.m_model.startChangingLinetool(a,b,c,d)};D77.prototype.lineBeingEdited=function(){return this.m_model.lineBeingEdited()};D77.prototype.changeLinePoint=function(a,b){this._currentLineChangeCommand.setPoint(a,b);this.m_model.changeLinePoint(a,b)};
|
|
D77.prototype.endChangingLinetool=function(){this.m_model.endChangingLinetool();this._currentLineChangeCommand.endChanging();this.pushUndoCommand(this._currentLineChangeCommand);this._currentLineChangeCommand=null};D77.prototype.startMovingSource=function(a,b,c){this._currentLineMoveCommand=new D86(this.m_model,a,b,c);this.m_model.startMovingSource(a,b,c)};D77.prototype.sourceBeingMoved=function(){return this.m_model.sourceBeingMoved()};
|
|
D77.prototype.moveSource=function(a){this._currentLineMoveCommand.setPoint(a);this.m_model.moveSource(a)};D77.prototype.endMovingSource=function(){this.m_model.endMovingSource();this.pushUndoCommand(this._currentLineMoveCommand);this._currentLineChangeCommand=null};D77.prototype.Z18=function(){return this.m_model.Z18()};D77.prototype.state=function(a){return this.m_model.state(a)};D77.prototype.asyncState=function(a){return this.m_model.asyncState(a)};
|
|
D77.prototype.restoreState=function(a,b){this.m_model.restoreState(a,b)};D77.prototype.calculateDefaultTags=function(){return this.m_model.calculateDefaultTags()};D77.prototype.onTagsChanged=function(){return this.m_model.onTagsChanged()};D77.prototype.changeZOrder=function(a,b){var c=new ChangeZOrderCommand(this.m_model,a,b);this.pushUndoCommand(c);c.redo();this.emitEvent("changeZOrder",[a])};
|
|
D77.prototype.sendToBack=function(a){var b=new SendToBackCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("changeZOrder",[a])};D77.prototype.bringToFront=function(a){var b=new BringToFrontCommand(this.m_model,a);this.pushUndoCommand(b);b.redo();this.emitEvent("changeZOrder",[a])};
|
|
D77.prototype.removeAllStudies=function(){this.beginUndoMacro("remove all studies");for(var a=this.m_model.Z18(),b=0;b<a.size();b++){var c=a.item(b);isInherited(c.constructor,TradingView.Study)&&c.removeByRemoveAllStudies()&&this.removeSource(c)}this.endUndoMacro()};
|
|
D77.prototype.removeAllDrawingTools=function(a){this.beginUndoMacro("remove all drawing tools");for(var b=this.m_model.Z18(),c=0;c<b.size();c++){var d=b.item(c);isInherited(d.constructor,D46)&&d.isActualSymbol()&&d.userEditEnabled()&&(a&&a!=d._constructor||this.removeSource(d))}this.endUndoMacro()};
|
|
D77.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()})};
|
|
D77.prototype.moveUp=function(){try{this.beginUndoMacro("Move Up")}catch(a){return}var b=this,c=this.m_model.mainSeries();pane=this.m_model.paneForSource(c);scale=pane.priceScaleForSource(c);scale.setAutoScale(!1);c=scale.height();TradingView.animate(c/5,function(a){b.startScrollPrice(pane,scale,a);b.scrollPriceTo(pane,scale,0);b.endScrollPrice(pane,scale)},function(){b.endUndoMacro()})};
|
|
D77.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()})};
|
|
D77.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()})};D77.prototype.scrollChart=function(a){this.startScrollTime(0);this.scrollTimeTo(a);this.endScrollTime()};
|
|
D77.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=c*((a+1)/2);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();d.startScrollTime(0);d.scrollTimeTo(a/2);d.endScrollTime()},
|
|
function(){d.endUndoMacro();d._onSimpleZoomIn.fire()})}};
|
|
D77.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();d.startScrollTime(a/2);d.scrollTimeTo(0);d.endScrollTime()},
|
|
function(){d.endUndoMacro();d._onSimpleZoomOut.fire()})}};D77.prototype.resetScales=function(){this.beginUndoMacro("Reset scales");this.resetTimeScale();for(var a=0;a<this.panes().size();a++){var b=this.panes().item(a);this.resetPriceScale(b,b.leftPriceScale());this.resetPriceScale(b,b.rightPriceScale())}this.endUndoMacro();this.m_model.recalculateAllPanes()};
|
|
D77.prototype.zoomToViewport=function(a,b,c,d,e){a=new ZoomCommand(this.m_model,a,b,c,d,e);a=new D94(a,this.m_zoomStack,!0);a.redo();this.pushUndoCommand(a)};D77.prototype.zoomFromViewport=function(){var a=new D94(this.m_zoomStack.head(),this.m_zoomStack,!1);a.redo();this.pushUndoCommand(a)};D77.prototype.zoomStack=function(){return this.m_zoomStack};
|
|
D77.prototype.addPaneStretchFactorUndoCommand=function(a,b,c,d){a=new D90(this.m_model,a,b,c,d);this.pushUndoCommand(a)};D77.prototype.restoreFactoryDefaults=function(a){a=new D89(this.m_model,a);a.redo();this.pushUndoCommand(a)};D77.prototype.chartLoadTheme=function(a,b){var c=new D80(a,b);c.redo();this.pushUndoCommand(c)};
|
|
D77.prototype.drawingLoadTemplate=function(a,b){var c=new D83(a,b);c.redo();this.pushUndoCommand(c)};D77.prototype.studyLoadTemplate=function(a,b,c,d){a=new D92(a,b,c,d);a.redo();this.pushUndoCommand(a)};D77.prototype.onSimpleZoomIn=function(){return this._onSimpleZoomIn};D77.prototype.onSimpleZoomOut=function(){return this._onSimpleZoomOut};
|
|
D77.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)};D77.prototype.cloneLineTool=function(a){a=new D81(this.m_model,a);a.redo();this.pushUndoCommand(a);this.emitEvent("cloneLineTool")};
|
|
D77.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))};D77.prototype.alertsList=function(){return this.m_model.alertsList()};D77.prototype.alertsListChanged=function(){return this.m_model.alertsListChanged()};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=new List;this.m_commands.setValidator(new TypeValidator(UndoCommand));this._onChange=new Delegate}UndoStack.prototype.onChange=function(){return this._onChange};UndoStack.prototype.isEmpty=function(){return this.m_commands.isEmpty()};
|
|
UndoStack.prototype.clear=function(){this.m_commands.clear();this._onChange.fire()};UndoStack.prototype.push=function(a){this.m_commands.append(a);this._onChange.fire()};UndoStack.prototype.pop=function(){if(this.m_commands.isEmpty())TradingView.logDebug("UndoStack.pop: undo stack is empty");else{var a=this.m_commands.item(this.m_commands.size()-1);this.m_commands.removeAt(this.m_commands.size()-1);this._onChange.fire();return a}};
|
|
UndoStack.prototype.head=function(){if(this.m_commands.isEmpty())TradingView.logDebug("UndoStack.head: undo stack is empty");else return this.m_commands.item(this.m_commands.size()-1)};function UndoMacroCommand(a){UndoCommand.call(this,a);this._subcommands=new List}inherit(UndoMacroCommand,UndoCommand);UndoMacroCommand.prototype.addCommand=function(a){this._subcommands.append(a)};UndoMacroCommand.prototype.isEmpty=function(){return this._subcommands.isEmpty()};
|
|
UndoMacroCommand.prototype.redo=function(){for(var a=0;a<this._subcommands.size();a++)this._subcommands.item(a).redo()};UndoMacroCommand.prototype.undo=function(){for(var a=this._subcommands.size()-1;0<=a;a--)this._subcommands.item(a).undo()};function SetPropertyCommand(a,b,c,d){UndoCommand.call(this,c);this._targetObj=a;this._newValue=b;this.D99=d}inherit(SetPropertyCommand,UndoCommand);
|
|
SetPropertyCommand.prototype.redo=function(){this._oldValue=this._targetObj.value();TradingView.saveDefaultProperties(!0);this._targetObj.setValue(this._newValue);TradingView.saveDefaultProperties(!1);this.D99&&(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))};
|
|
SetPropertyCommand.prototype.undo=function(){TradingView.saveDefaultProperties(!0);this._targetObj.setValue(this._oldValue);TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D99&&(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))};function SetAutoScalePropertyCommand(a,b,c,d,e){UndoCommand.call(this,d);this._property=a;this._priceScale=c;this._newValue=b;this.D99=e}
|
|
inherit(SetAutoScalePropertyCommand,UndoCommand);
|
|
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.D99&&(this.D99.recalculateAllPanes(),
|
|
this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))};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.D99&&(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))};
|
|
function SetPercentagePropertyCommand(a,b,c,d,e){UndoCommand.call(this,d);this._percentage=a;this._priceScale=c;this._newValue=b;this.D99=e}inherit(SetPercentagePropertyCommand,UndoCommand);
|
|
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.D99&&(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))};
|
|
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.D99.timeScale().visibleBars();
|
|
this._priceScale.setPriceRange(this._priceScale.priceRange().convertFromPercents(this._priceScale.mainSource().close(a.firstBar())))}TradingView.saveDefaultProperties(!1);this._oldValue=null;this.D99&&(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))};function SetLogPropertyCommand(a,b,c,d,e){UndoCommand.call(this,d);this._log=a;this._priceScale=c;this._newValue=b;this.D99=e}inherit(SetLogPropertyCommand,UndoCommand);
|
|
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.D99&&
|
|
(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))};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.D99&&(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))};
|
|
function SetChartStyleCommand(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.D99=e;this.Z3=f}inherit(SetChartStyleCommand,UndoCommand);
|
|
SetChartStyleCommand.prototype.redo=function(){var a=$.Deferred().resolve();this._mainSeries.Z1.style===this._style&&this.D99.mainSeries().isNeedRestart(this._newValue)&&(a=this.Z3.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.Z3.model()._preparePriceAxisProperties(this._mainSeries.properties(),this._priceAxisProperties);TradingView.saveDefaultProperties(!1);this.D99&&(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))}.bind(this))};
|
|
SetChartStyleCommand.prototype.undo=function(){var a=$.Deferred().resolve();this._mainSeries.Z1.style===this._style&&this.D99.mainSeries().isNeedRestart(this._newValue)&&(a=this.Z3.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.D99&&(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))}.bind(this))};
|
|
function SetLockScaleCommand(a,b,c,d,e){UndoCommand.call(this,d);this._property=a;this._mainSeries=c;this._priceAxisProperties=c.properties().priceAxisProperties;this._newValue=b;this.D99=e}inherit(SetLockScaleCommand,UndoCommand);
|
|
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.D99&&(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))};
|
|
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.D99&&(this.D99.recalculateAllPanes(),this.D99.Z19(new Q22(Q22.LIGHT_UPDATE)))};
|
|
D88=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(D88,UndoCommand);D88.prototype.undo=function(){null!==this.m_newPriceScaleState?TradingView.logDebug("D88.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))};
|
|
D88.prototype.redo=function(){null===this.m_newPriceScaleState?TradingView.logDebug("D88.redo: Command is not undone"):(this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_newPriceScaleState),this.m_newPriceScaleState=null)};D93=function(a,b,c){UndoCommand.call(this,c);this.m_model=a;this.m_state=b;this.m_newTimeScaleState=null};inherit(D93,UndoCommand);
|
|
D93.prototype.undo=function(){null!==this.m_newTimeScaleState?TradingView.logDebug("D93.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())};
|
|
D93.prototype.redo=function(){null===this.m_newTimeScaleState?TradingView.logDebug("D93.redo: Command is not undone"):(this.m_model.restoreTimeScaleState(this.m_newTimeScaleState),this.m_newTimeScaleState=null)};D85=function(a,b,c,d){this.D99=a;this._series=b;this._oldSymbol=b.symbol();this._oldInterval=b.interval();this._symbol=c;this._interval=d};inherit(D85,UndoCommand);
|
|
D85.prototype.redo=function(){this.D99.modifySeries(this._series,this._symbol,this._interval)};D85.prototype.undo=function(){this.D99.modifySeries(this._series,this._oldSymbol,this._oldInterval)};InsertStudyCommand=function(a,b,c,d){UndoCommand.call(this,"Insert "+b.id);this.D99=a;this._studyMetaInfo=b;this._props=c;this._isOverlay=d};inherit(InsertStudyCommand,UndoCommand);
|
|
InsertStudyCommand.prototype.redo=function(){return this.Z0=this.D99.insertStudy(this._studyMetaInfo,this._props,this._isOverlay)};InsertStudyCommand.prototype.undo=function(){this.D99.removeSource(this.Z0)};function RemoveSourceCommand(a,b){this.D99=a;this.D98=b}inherit(RemoveSourceCommand,UndoCommand);
|
|
RemoveSourceCommand.prototype.redo=function(){var a=this.D99.paneForSource(this.D98);this._paneIndex=this.D99.panes().indexOf(a);this._priceScaleName=a.priceScaleName(this.D98.priceScale());var b=this.D99.children(this.D98);this._removeChildUndoCommands=new List;for(var c=0;c<b.size();c++){var d=b.item(c),d=new RemoveSourceCommand(this.D99,d);this._removeChildUndoCommands.append(d);d.redo()}this._paneState=a.state();this._restorePane=this.D99.removeSource(this.D98);
|
|
this.D99.recalculateAllPanes();this.D99.Z19(new Q22(Q22.FULL_UPDATE,!0))};
|
|
RemoveSourceCommand.prototype.undo=function(){var a;a=this._restorePane?this.D99.createPane(this._paneIndex):this.D99.panes().item(this._paneIndex);var b=this.D98.ownerSource()?this.D98.ownerSource().priceScale():a.priceScaleByName(this._priceScaleName);a.addDataSource(this.D98,b);this.D98.start();this.D98.restore&&this.D98.restore();this._restorePane&&a.restoreState(this._paneState);for(a=this._removeChildUndoCommands.size()-1;0<=a;a--)this._removeChildUndoCommands.item(a).undo();
|
|
this._removeChildUndoCommands.clear();this.D99.recalculateAllPanes();this.D99.Z19(new Q22(Q22.FULL_UPDATE,!0))};
|
|
function D87(a,b,c,d,e){this.D99=a;this.D98=b;this._scale=e;this._sources=new List;this._sources.append(b);this._sources.appendAll(this.D99.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(D87,UndoCommand);D87.prototype.redo=function(){this.D99.move(this.D98,this._pane,this._scale)};
|
|
D87.prototype.undo=function(){var a=!1;if(this._samePane)this._oldPane.restoreState(this._oldPaneState);else{for(var b=0;b<this._sources.size();b++)this.D99.detachSource(this._sources.item(b));if(this.D99.panes().contains(this._oldPane)){for(var c=this._oldPane.priceScaleByName(this._oldScaleName),b=0;b<this._sources.size();b++)this._oldPane.addDataSource(this._sources.item(b),c);this._oldPane.restoreState(this._oldPaneState)}else{this._oldPane=this.D99.createPane(this._oldPaneIndex);
|
|
c=this._oldPane.priceScaleByName(this._oldScaleName);for(b=0;b<this._sources.size();b++)this._oldPane.addDataSource(this._sources.item(b),c);a=!0}}this.D99.recalculateAllPanes();a&&this.D99.Z19(new Q22(Q7.FULL_UPDATE))};function D82(a,b,c,d){UndoCommand.call(this,"Create line "+b.toolname);this.D99=a;this._line=b;this._paneIndex=a.panes().indexOf(c);this._points=new List;this._points.append({point:d})}
|
|
inherit(D82,UndoCommand);D82.prototype.coninueCreatingLine=function(a,b){this._points.append({point:a,envState:b})};D82.prototype.undo=function(){this.D99.removeSource(this._line)};
|
|
D82.prototype.redo=function(){var a=this.D99.panes().item(this._paneIndex);this._line=this.D99.createLineTool(a,this._points.item(0).point,this._line.toolname);for(a=1;a<this._points.size();a++)this.D99.coninueCreatingLine(this._points.item(a).point,this._points.item(a).envState)};function D79(a,b,c,d){this.D99=a;this.D98=b;this._nextState=this._prevState=b.state(!0)}inherit(D79,UndoCommand);
|
|
D79.prototype.setPoint=function(a){this._nextState=this.D98.state(!0)};D79.prototype.endChanging=function(){this._nextState=this.D98.state(!0)};D79.prototype.undo=function(){var a=this.D98,b=this._prevState;a.restorePoints(b.points,b.indexes||[]);a.properties().merge(b.state);a.restoreData&&a.restoreData(b);a.createServerPoints();this.D99.Z19(new Q22(Q22.FULL_UPDATE))};
|
|
D79.prototype.redo=function(){var a=this.D98,b=this._nextState;a.restorePoints(b.points,b.indexes||[]);a.properties().merge(b.state);a.restoreData&&a.restoreData(b);a.createServerPoints();this.D99.Z19(new Q22(Q22.FULL_UPDATE))};function D86(a,b,c,d){this.D99=a;this.D98=b;this._origPoint=c instanceof MathEx.Point?c.clone():TradingView.clone(c);this._pointIndex=d}inherit(D86,UndoCommand);
|
|
D86.prototype.setPoint=function(a){this._point=a instanceof MathEx.Point?a.clone():TradingView.clone(a)};D86.prototype.undo=function(){this.D99.startMovingSource(this.D98,this._point,this._pointIndex);this.D99.moveSource(this._origPoint);this.D99.endMovingSource()};D86.prototype.redo=function(){this.D99.startMovingSource(this.D98,this._origPoint,this._pointIndex);this.D99.moveSource(this._point);this.D99.endMovingSource()};
|
|
function ChangeZOrderCommand(a,b,c){UndoCommand.call(this,"Change "+b.title()+" Z order");this.D99=a;this.D98=b;this._shift=c}inherit(ChangeZOrderCommand,UndoCommand);ChangeZOrderCommand.prototype.undo=function(){this.D99.changeZOrder(this.D98,-this._shift)};ChangeZOrderCommand.prototype.redo=function(){this.D99.changeZOrder(this.D98,this._shift)};function SendToBackCommand(a,b){UndoCommand.call(this,"Change "+b.title()+" Z order");this.D99=a;this.D98=b}
|
|
inherit(SendToBackCommand,UndoCommand);SendToBackCommand.prototype.undo=function(){this.D99.bringToFront(this.D98)};SendToBackCommand.prototype.redo=function(){this.D99.sendToBack(this.D98)};function BringToFrontCommand(a,b){UndoCommand.call(this,"Change "+b.title()+" Z order");this.D99=a;this.D98=b}inherit(BringToFrontCommand,UndoCommand);BringToFrontCommand.prototype.undo=function(){this.D99.sendToBack(this.D98)};BringToFrontCommand.prototype.redo=function(){this.D99.bringToFront(this.D98)};
|
|
D77.prototype.removePane=function(a,b){var c=new RemovePaneCommand(this,b,a);this.pushUndoCommand(c);c.redo()};function RemovePaneCommand(a,b,c){UndoCommand.call(this,"Remove pane");this.D99=a;this._index=b;this._pane=this.D99.panes().item(b);this._chart=c}inherit(RemovePaneCommand,UndoCommand);RemovePaneCommand.prototype.redo=function(){this.D99.panes().removeAt(this._index);this._chart._updateGui()};
|
|
RemovePaneCommand.prototype.undo=function(){this.D99.panes().insert(this._pane,this._index);this._chart._updateGui()};D77.prototype.rearrangePanes=function(a,b,c){a=new RearrangePanesCommand(this,b,c,a);this.pushUndoCommand(a);a.redo()};function RearrangePanesCommand(a,b,c,d){UndoCommand.call(this,"Rearrange panes");this.D99=a;this._index=b;this._direction=c;this._chart=d}inherit(RearrangePanesCommand,UndoCommand);
|
|
RearrangePanesCommand.prototype.redo=function(){var a=this.D99.panes().item(this._index);"up"===this._direction&&0<this._index&&(this.D99.panes().removeAt(this._index),this.D99.panes().insert(a,this._index-1));"down"===this._direction&&this._index<this.D99.panes().size()-1&&(this.D99.panes().removeAt(this._index),this.D99.panes().insert(a,this._index+1));this.D99.Z19(new Q22(Q22.FULL_UPDATE))};
|
|
RearrangePanesCommand.prototype.undo=function(){if("up"===this._direction){var a=this.D99.panes().item(this._index-1);this.D99.panes().removeAt(this._index-1);this.D99.panes().insert(a,this._index)}"down"===this._direction&&(a=this.D99.panes().item(this._index+1),this.D99.panes().removeAt(this._index+1),this.D99.panes().insert(a,this._index));this.D99.Z19(new Q22(Q22.FULL_UPDATE))};
|
|
function ZoomCommand(a,b,c,d,e,f){this.D99=a;this._startBar=b;this._endBar=c;this._startPrice=d;this._endPrice=e;this._pane=f}inherit(ZoomCommand,UndoCommand);ZoomCommand.prototype.redo=function(){this._timeScaleState=this.D99.timeScale().state();this._priceScaleState=this._pane.defaultPriceScale().state();this.D99.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)};
|
|
ZoomCommand.prototype.undo=function(){this.D99.timeScale().restoreState(this._timeScaleState);this._pane.defaultPriceScale().restoreState(this._priceScaleState);this.D99.recalculateAllPanes();this.D99.Z19(new Q22(Q22.LIGHT_UPDATE))};function D94(a,b,c){this._baseCmd=a;this._zoomStack=b;this._inOut=c}inherit(D94,UndoCommand);
|
|
D94.prototype.undo=function(){this._inOut?this._baseCmd!==this._zoomStack.head()?TradingView.logDebug("zoom stack inconsistency"):(this._baseCmd.undo(),this._zoomStack.pop()):(this._baseCmd.redo(),this._zoomStack.push(this._baseCmd))};D94.prototype.redo=function(){this._inOut?(this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)):this._baseCmd!==this._zoomStack.head()?TradingView.logDebug("zoom stack inconsistency"):(this._baseCmd.undo(),this._zoomStack.pop())};
|
|
function D90(a,b,c,d,e){this.D99=a;this._paneA=b;this._paneB=c;this._prevStretchA=d;this._currStretchA=e}inherit(D90,UndoCommand);D90.prototype.redo=function(){var a=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA;this._paneB._stretchFactor=a-this._currStretchA;this.D99.Z19(new Q22(Q22.FULL_UPDATE))};
|
|
D90.prototype.undo=function(){var a=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA;this._paneB._stretchFactor=a-this._prevStretchA;this.D99.Z19(new Q22(Q22.FULL_UPDATE))};function D89(a,b){UndoCommand.call(this,"Restore Defaults");this.D99=a;this._defaultProperty=b;this._state=b.state(b._exclusions)}inherit(D89,UndoCommand);
|
|
D89.prototype.redo=function(){this.D99.restoreFactoryDefaults(this._defaultProperty)};D89.prototype.undo=function(){this._defaultProperty.merge(this._state);this._defaultProperty.listeners().fire(this._defaultProperty);this.D99.mainSeries().onChartStyleChanged()};
|
|
function D80(a,b){UndoCommand.call(this,"Apply Chart Theme");this.D99=a;this._newChartProps=b.chartProperties;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(D80,UndoCommand);
|
|
D80.prototype._merge=function(a,b){var c=this.D99;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().W62();c._version=b.version;c.recalculateAllPanes();c.Z19(new Q22(Q22.FULL_UPDATE));
|
|
c.properties().saveDefaults();c.properties().listeners().fire(this.Z1);TradingView.saveDefaultProperties(!1)};D80.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps);this.D99.mainSeries().onChartStyleChanged()};D80.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps);this.D99.mainSeries().onChartStyleChanged()};
|
|
function D83(a,b){UndoCommand.call(this,"Apply Drawing Template");this.D98=a;this._oldProps=a.properties().state();this._newProps=b}inherit(D83,UndoCommand);D83.prototype._merge=function(a){var b=this.D98;b.properties().merge(a);b.properties().saveDefaults();b.updateAllViews();b.D99.Z19(new Q22(Q22.LIGHT_UPDATE))};
|
|
D83.prototype.undo=function(){this._merge(this._oldProps)};D83.prototype.redo=function(){this._merge(this._newProps)};function D92(a,b,c,d){UndoCommand.call(this,(" "+d||"")+" Study template");this.D99=a;this._oldProps=b;this._newProps=c}inherit(D92,UndoCommand);
|
|
D92.prototype._merge=function(a){var b=this.D99.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.size();f--;)for(var g=e.item(f),h=g.containsMainSeries(),k=g.Z18(),g=k.size();g--;){var l=k.item(g);if(!h||l instanceof TradingView.Study||l instanceof TradingView.AlertLabel)l.isRemovedByStudyTemplates()||d.push(l),b.removeSource(l)}h=a.panes;for(f=0;f<h.length;f++){for(var k=
|
|
!1,m=h[f],g=0;g<m.sources.length;g++)l=m.sources[g],"MainSeries"===l.type&&(delete l.state,k=!0);g=null;g=k?e.item(f):b.createPane(f);g.restoreState(h[f],!1,a.version);if(k)for(l=0;l<d.length;l++){d[l].restore&&d[l].restore();var q=d[l];q instanceof TradingView.AlertLabel&&!g.Z18().find(function(a){return a.alert&&a.alert().id()===q.alert.id()})||g.Z18().append(q)}g.updateAlertLabelsSources()}c.priceScale().setAutoScale(!0);b._version=a.version;b.startNotStartedStudies();b.recalculateAllPanes();
|
|
b.Z19(new Q22(Q22.FULL_UPDATE))};D92.prototype.undo=function(){this._merge(this._oldProps);this.D99.model().mainSeries().onChartStyleChanged()};
|
|
D92.prototype.redo=function(){this._merge(this._newProps);this.D99.model().mainSeries().onChartStyleChanged();var a=this.D99.model().mainSeries().properties(),b=this.D99.model().mainSeries().properties().priceAxisProperties;this.D99._preparePriceAxisProperties(a,b)};
|
|
function SetPriceScaleMarginsCommand(a,b,c,d,e){this.D99=a;this._pane=b;this._priceScale=c;this._topMargin=d;this._bottomMargin=e;this._oldTopMargin=c.topMargin();this._oldBottomMargin=c.bottomMargin()}inherit(SetPriceScaleMarginsCommand,UndoCommand);SetPriceScaleMarginsCommand.prototype.redo=function(){this._priceScale.setTopMargin(this._topMargin);this._priceScale.setBottomMargin(this._bottomMargin);this.D99.recalculatePane(this._pane,!1)};
|
|
SetPriceScaleMarginsCommand.prototype.undo=function(){this._priceScale.setTopMargin(this._oldTopMargin);this._priceScale.setBottomMargin(this._oldBottomMargin);this.D99.recalculatePane(this._pane,!1)};function D84(a,b){this.D99=a;this._range=b}inherit(D84,UndoCommand);D84.prototype.redo=function(){this.D99.mainSeries().loadDataTo(this._range)};
|
|
function D91(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(D91,UndoCommand);D91.prototype.redo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._value,this._forceSetProperty)}.bind(this))};
|
|
D91.prototype.undo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._prevValue,this._forceSetProperty)}.bind(this))};function D81(a,b){UndoCommand.call(this,"clone "+b.title());this.D99=a;this.D98=b;this._points=new List}inherit(D81,UndoCommand);
|
|
D81.prototype.redo=function(){if(this.D98){var a=this.D98,b=a.priceScale(),c=this.D99.paneForSource(a),d=TradingView.className(a.constructor);this._line=new TradingView[d](this.D99,new W51(d.toLowerCase(),a.properties().state()));this._line.setOwnerSource(a.ownerSource());this._line.properties().visible._value=!0;this._line._fixedPoints.appendAll(a._fixedPoints);for(var e=0;e<this._line._fixedPoints.size();e++)this._line._fixedPoints.setItem(e,this._line._fixedPoints.item(e).add(new MathEx.Point(20,
|
|
20)));var f=a._timePoint.toArray(),d=[];if(b.isPercent())var g=a.ownerSource().firstValue();for(e=0;e<f.length;e++){var h={offset:f[e].offset,time_t:f[e].time_t},k=f[e].price;b.isPercent()&&(k=b.priceRange().convertToPercent(k,g));k=b.priceToCoordinate(k);k-=40;k=b.coordinateToPrice(k);b.isPercent()&&(k=b.priceRange().convertFromPercent(k,g));h.price=k;d.push(h)}g=a._points.toArray();this._line.restorePoints(d,g);this._line.cloneData&&this._line.cloneData(a);c.addDataSource(this._line,b);this.D99.updateSource(this._line);
|
|
this._line.checkAlert&&this._line.checkAlert();this._points=this._line.points();this._paneIndex=this.D99.panes().indexOf(c);this._toolname=a._constructor;delete this.D98}else for(c=this.D99.panes().item(this._paneIndex),this._line=this.D99.createLineTool(c,this._points.item(0),this._toolname),e=1;e<this._points.size();e++)this.D99.coninueCreatingLine(this._points.item(e))};
|
|
D81.prototype.undo=function(){this.D99.removeSource(this._line);this.D99.Z19(new Q22(Q22.LIGHT_UPDATE,!0))};Q77.setWatchedValue=function(a,b,c){a.value()!==b&&(a=new SetWatchedValueCommand(a,b,c),this.pushUndoCommand(a),a.redo())};function SetWatchedValueCommand(a,b,c){UndoCommand.call(this,c);this._wv=a;this._newValue=b;this._oldValue=a.value()}inherit(SetWatchedValueCommand,UndoCommand);
|
|
SetWatchedValueCommand.prototype.redo=function(){this._wv.setValue(this._newValue)};SetWatchedValueCommand.prototype.undo=function(){this._wv.setValue(this._oldValue)};function D78(a,b,c,d,e,f,g,h){this._version=D78.version;this._readOnly=d;this._undoModel=h;this._studiesMetaData=f;this._studyVersioning=new Q0(this._studiesMetaData,g);this.m_timeScale=new D48(this,c.timeScale);this.m_panes=new List;this.m_gridSource=new Grid;this.m_crossHairSource=new CrossHair(this,TradingView.drawingState.properties());this.m_width=0;this._tagsChanged=new Delegate;this.Z1=c;this._lineCancelled=new Delegate;this._magnet=new Q47(TradingView.drawingState.properties().magnet,
|
|
this.m_timeScale,c.paneProperties.magnetSensivity);this._alertsList=new List;var k=new W51("chartproperties.mainSeriesProperties");k.addExclusion("lockScale");k.addExclusion("minTick");k.addExclusion("priceAxisProperties.percentage");k.addExclusion("priceAxisProperties.log");this.createPane(void 0,!1,{rightAxisProperties:k.priceAxisProperties.state(["autoScale"])});this.m_panes.item(0)._stretchFactor=2*D74.DEFAULT_STRETCH_FACTOR;this.m_selectedSource=null;this._selectedSourceChanged=
|
|
new Delegate;this._chartApi=a;this._invalidateHandler=b;this.m_hoveredSource=null;this.Z1.listeners().subscribe(this,D78.prototype.propertyChangeHandler);var l=this;this.Z1.timezone.listeners().subscribe(null,function(){l._chartApi&&l._chartApi.connected()&&l._chartApi.switchTimezone(l.timezone())});this.Z1.timeScale.rightOffset.listeners().subscribe(null,function(){l.m_timeScale.setOffset(l.Z1.timeScale.rightOffset.value());l.recalculateAllPanes()});k.merge(c.mainSeriesProperties.state());
|
|
this.m_mainSeries=new TradingView.Series(this,k,e);this.panes().item(0).addDataSource(this.m_mainSeries,this.panes().item(0).rightPriceScale());this.m_mainSeries.onCompleted().subscribe(this,function(){l.clearCurrentPosition()});d||(k.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),k.lockScale.listeners().subscribe(this,function(a){if(a=a.value())k.priceAxisProperties.percentage.setValue(!1),k.priceAxisProperties.logDisabled.setValue(!1);k.priceAxisProperties.percentageDisabled.setValue(a);
|
|
k.priceAxisProperties.logDisabled.setValue(a)}));this._barsMarksSources=[];a=D76.enabled("charting_library")?new UserDefinedBarsMarks(this):new PublishedChartsTimeline(this);a.setOwnerSource(this.m_mainSeries);this._barsMarksSources.push(a);this.m_watermarkSource=new Watermark(this.m_mainSeries);var m=this._undoModel.Z3;TradingView.Z17("alerts")&&!m.onWidget()&&(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.rightPriceScale()||d.leftPriceScale();e&&d.addDataSource(new TradingView.AlertLabel(c,a),e)}}var c=this;if(a.isOHLC())b(c.paneForSource(c.m_mainSeries));else for(var d=c.m_panes.size()-1;0<=d;d--)b(c.m_panes.item(d));m.update()}),this._alertsList.onRemove.subscribe(this,function(a){for(var b=this.m_panes.size()-1;0<=b;b--){var c=this.m_panes.item(b),d=c.Z18().find(function(b){return b.alert&&b.alert()&&b.alert().id()===
|
|
a.id()});d&&c.removeDataSource&&c.removeDataSource(d)}m.update()}),this._prepareAlertsList());this._oldEndVisibleIndex=this._oldStartVisibleIndex=-1;this._currentTool="";TradingView.drawingState.hideAllDrawings().subscribe(this,D78.prototype.visibilityChangeHandler)}D78.prototype.currentTool=function(){return this._currentTool};D78.prototype.setCurrentTool=function(a){this._currentTool=a};D78.prototype.timezone=function(){return this.Z1.timezone.value()};
|
|
D78.prototype.version=function(){return this._version};D78.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())};D78.prototype.dumpViews=function(){for(var a={panes:[]},b=0;b<this.m_panes.size();b++)a.panes.push(this.m_panes.item(b).dumpViews());a.dataWindow=[];for(var c=this.Z18(),b=0;b<c.size();b++){var d=c.item(b).dataWindowView();d&&a.dataWindow.push(d.dump())}return a};
|
|
D78.prototype._paneInvalidationMask=function(a,b){var c=new Q22,d=this.m_panes.indexOf(a);void 0===b&&(b=Q22.LIGHT_UPDATE);c.invalidatePane(d,b);return c};D78.prototype.updatePane=function(a){a=this._paneInvalidationMask(a);this.Z19(a)};D78.prototype.fullUpdate=function(a){this.Z19(new Q22(Q22.FULL_UPDATE))};
|
|
D78.prototype.updateSource=function(a){a=this.paneForSource(a);a=this._paneInvalidationMask(a);this.Z19(a)};D78.prototype.studiesMetaData=function(){return this._studiesMetaData};D78.prototype.studyVersioning=function(){return this._studyVersioning};D78.prototype.disconnect=function(){for(var a=this.Z18(),b=0;b<a.size();b++)a.item(b).disconnect&&a.item(b).disconnect()};
|
|
D78.prototype.restart=function(){this.initConnection();this.m_timeScale.reset();this.m_mainSeries.restart();for(var a=this.Z18(),b=0;b<a.size();b++)a.item(b).restart&&a.item(b)!==this.m_mainSeries&&a.item(b).restart()};
|
|
D78.prototype.startNotStartedStudies=function(){if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(var a=this.Z18(),b=0;b<a.size();b++)a.item(b)instanceof TradingView.Study&&!a.item(b).isStarted()&&a.item(b).restart&&a.item(b)!==this.m_mainSeries&&a.item(b).restart()};
|
|
D78.prototype.updateLineTools=function(){for(var a=this.Z18(),b=0;b<a.size();b++)if(isInherited(a.item(b).constructor,D46)){var c=a.item(b);c.tryCreateServerPoints();c.checkAlert&&c.checkAlert()}};D78.prototype.realignLineTools=function(){for(var a=this.Z18(),b=0;b<a.size();b++)isInherited(a.item(b).constructor,D46)&&a.item(b).calcIsActualSymbol();for(b=0;b<this.panes().size();b++)this.panes().item(b).invalidateSourcesCache()};
|
|
D78.prototype.readOnly=function(){return this._readOnly};D78.prototype.properties=function(){return this.Z1};D78.prototype.lineCancelled=function(){return this._lineCancelled};D78.prototype.chartApi=function(){return this._chartApi};D78.prototype.propertyChangeHandler=function(){this.Z19(new Q22(Q22.LIGHT_UPDATE))};D78.prototype.visibilityChangeHandler=function(){this.setSelectedSource();this.Z19(new Q22(Q22.LIGHT_UPDATE))};
|
|
D78.prototype.updateAllPaneViews=function(){for(var a=0;a<this.panes().size();a++)this.panes().item(a).updateAllViews()};D78.prototype.mainSeries=function(){return this.m_mainSeries};D78.prototype.timeScale=function(){return this.m_timeScale};D78.prototype.panes=function(){return this.m_panes};D78.prototype.gridSource=function(){return this.m_gridSource};D78.prototype.watermarkSource=function(){return this.m_watermarkSource};
|
|
D78.prototype.crossHairSource=function(){return this.m_crossHairSource};D78.prototype.publishedChartsTimelineSource=function(){for(var a=0;a<this._barsMarksSources.length;++a)if(this._barsMarksSources[a]instanceof PublishedChartsTimeline)return this._barsMarksSources[a]};D78.prototype.barsMarksSources=function(){return this._barsMarksSources};D78.prototype.width=function(){return this.m_width};
|
|
D78.prototype.setPaneHeight=function(a,b){a.setHeight(b);this.recalculateAllPanes();this.Z19(new Q22(Q22.LIGHT_UPDATE))};D78.prototype.setWidth=function(a){this.m_width=a;this.m_timeScale.setWidth(this.m_width);for(var b=0;b<this.m_panes.size();++b)this.m_panes.item(b).setWidth(a);this.recalculateAllPanes()};
|
|
D78.prototype.createPane=function(a,b,c){var d=this.Z1.paneProperties;c&&d.merge(c);b=new D74(this.m_timeScale,d,this,b);if(void 0!==a){if(0>a||a>this.m_panes.size()){TradingView.logDebug("D78.createPane: invalid index: "+a);return}this.m_panes.insert(b,a)}else this.m_panes.append(b);b.onTagsChanged().subscribe(this,D78.prototype.onPaneTagsChanged);return b};D78.prototype.removePane=function(a){this.m_panes.remove(a);this.Z19(new Q22(Q22.FULL_UPDATE))};
|
|
D78.prototype.startScalePrice=function(a,b,c){a.startScalePrice(b,c)};D78.prototype.scalePriceTo=function(a,b,c){a.scalePriceTo(b,c);this.mainSeries().properties().lockScale.value()?this.Z19(new Q22(Q22.LIGHT_UPDATE)):this.Z19(this._paneInvalidationMask(a,Q22.LIGHT_UPDATE))};D78.prototype.endScalePrice=function(a,b){a.endScalePrice(b);this.Z19(this._paneInvalidationMask(a,Q22.LIGHT_UPDATE))};
|
|
D78.prototype.startScrollPrice=function(a,b,c){a.startScrollPrice(b,c)};D78.prototype.scrollPriceTo=function(a,b,c){a.scrollPriceTo(b,c);this.Z19(this._paneInvalidationMask(a,Q22.LIGHT_UPDATE))};D78.prototype.endScrollPrice=function(a,b){a.endScrollPrice(b);this.Z19(this._paneInvalidationMask(a,Q22.LIGHT_UPDATE))};
|
|
D78.prototype.setPriceAutoScale=function(a,b,c){a.setPriceAutoScale(b,c);this.Z19(this._paneInvalidationMask(a,Q22.LIGHT_UPDATE))};D78.prototype.restorePriceScaleState=function(a,b,c){a.restorePriceScaleState(b,c);this.Z19(this._paneInvalidationMask(a,Q22.LIGHT_UPDATE))};D78.prototype.resetPriceScale=function(a,b){a.resetPriceScale(b);this.Z19(this._paneInvalidationMask(a,Q22.LIGHT_UPDATE))};
|
|
D78.prototype.startScaleTime=function(a){this.m_timeScale.startScale(a)};D78.prototype.scaleTimeTo=function(a){this.m_timeScale.scaleTo(a);this.recalculateAllPanes();this.Z19(new Q22(Q22.LIGHT_UPDATE))};D78.prototype.endScaleTime=function(){this.m_timeScale.endScale();this.Z19(new Q22(Q22.LIGHT_UPDATE));this.mainSeries().requestMoreData();this.recalcVisibleRangeStudy(this.Z18())};
|
|
D78.prototype.startScrollTime=function(a){this.m_timeScale.startScroll(a)};D78.prototype.scrollTimeTo=function(a){this.m_timeScale.scrollTo(a);this.recalculateAllPanes();this.Z19(new Q22(Q22.LIGHT_UPDATE))};D78.prototype.endScrollTime=function(){this.m_timeScale.endScroll();this.Z19(new Q22(Q22.LIGHT_UPDATE));this.mainSeries().requestMoreData();this.recalcVisibleRangeStudy(this.Z18())};
|
|
D78.prototype.recalcVisibleRangeStudy=function(a,b){if(!this.timeScale().isEmpty()){var c=this.timeScale().visibleBars(),d=this.mainSeries().nearestData(c.firstBar(),SEARCH_NEAREST_RIGHT),c=this.mainSeries().nearestData(c.lastBar(),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.size();e++)if(a.item(e)instanceof TradingView.Study)for(var f=a.item(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[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[TIME_PLOT]:0,f.properties().inputs.last_visible_bar_time.setValue(1E3*Math.floor(k)))}}};
|
|
D78.prototype.resetTimeScale=function(){this.m_timeScale.restoreDefault();this.recalculateAllPanes();this.mainSeries().requestMoreData();this.recalcVisibleRangeStudy(this.Z18());this.Z19(new Q22(Q22.LIGHT_UPDATE))};D78.prototype.restoreTimeScaleState=function(a){this.m_timeScale.restoreState(a);this.recalculateAllPanes();this.Z19(new Q22(Q22.LIGHT_UPDATE))};
|
|
D78.prototype.restoreFactoryDefaults=function(a){a.restoreFactoryDefaults();this.recalcVisibleRangeStudy(this.Z18(),!0);this.mainSeries().onChartStyleChanged()};
|
|
D78.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 Q22;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));c.force=!0;this.Z19(new Q22(Q22.LIGHT_UPDATE));
|
|
this.setHoveredSource(a,b)}};D78.prototype.checkLineToolSelection=function(){this.m_selectedSource&&this.m_selectedSource instanceof D46&&(this.m_selectedSource.calcIsActualSymbol(),this.m_selectedSource.isActualSymbol()||this.setSelectedSource(null))};D78.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged};
|
|
D78.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 Q22),c.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource),Q22.LIGHT_UPDATE)));if(this.m_hoveredSource=a)a.updateAllViews(),c||(c=new Q22),c.merge(this._paneInvalidationMask(this.paneForSource(a),
|
|
Q22.LIGHT_UPDATE));c&&this.Z19(c)}};D78.prototype.selectedSource=function(){return this.m_selectedSource};D78.prototype.hoveredSource=function(){return this.m_hoveredSource};D78.prototype.lastHittestData=function(){return this._lastHittestData};D78.prototype.Z19=function(a){this._invalidateHandler&&this._invalidateHandler(a)};
|
|
D78.prototype.Z18=function(){var a=[];a.push(this.m_crossHairSource);for(var b=0;b<this.m_panes.size();++b)a=a.concat(this.m_panes.item(b).Z18().toArray());return new List(a)};D78.prototype.dataSourceForId=function(a){for(var b,c=0;c<this.m_panes.size();++c)if(b=this.m_panes.item(c).dataSourceForId(a))return b;return null};D78.prototype.children=function(a){for(var b=this.Z18(),c=new List,d=0;d<b.size();d++){var e=b.item(d);e.ownerSource()===a&&c.append(e)}return c};
|
|
D78.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||D46.isLineTool(this.currentTool()))e=this._magnet.align(e,a,c);this.m_crossHairSource.setPosition(a,e,c);this.m_crossHairSource.dataWindowView().update();b=this.m_panes.toArray();for(c=b.length;c--;)for(var f=b[c].Z18().toArray(),g=f.length;g--;){var h=f[g].dataWindowView();
|
|
h&&h.update()}this._lineBeingCreated?(this._lineBeingCreated.setLastPoint({index:a,price:e},d),this._lineBeingCreated.updateAllViews(),this.Z19(new Q22(Q22.LIGHT_UPDATE))):this.crossHairSource().startMeasurePoint()?this.Z19(new Q22(Q22.LIGHT_UPDATE)):this.Z19(new Q22(Q22.UPDATE_CURSOR_ONLY));d=this._undoModel.Z3;d.Z4&&
|
|
(e=this.m_timeScale.points().valueAt(a),isNaN(e)&&0<a&&(e=Infinity),d.Z4.syncCrosshair(e,d))};D78.prototype.clearCurrentPosition=function(){this.crossHairSource().clearPosition();this.fullUpdate();var a=this._undoModel.Z3;a.Z4&&a.Z4.syncCrosshair(NaN,a)};
|
|
D78.prototype.setExternalPosition=function(a){a=this.m_timeScale.points().closestIndexLeft(a);if(isFinite(a)){this.crossHairSource().setPosition(a,NaN,null);a=this.Z18();for(var b=a.size();b--;){var c=a.item(b).dataWindowView();c&&c.update()}}else this.crossHairSource().visible=!1;this.Z19(new Q22(Q22.UPDATE_CURSOR_ONLY))};
|
|
D78.prototype.updateTimeScale=function(a,b,c,d,e){if(e){this.m_timeScale.reset();e=this.Z18();for(var f=0;f<e.size();f++)e.item(f).clearData&&e.item(f).clearData()}this.m_timeScale.update(a,b,c,d);this.recalculateAllPanes();this.Z19(new Q22(Q22.LIGHT_UPDATE))};D78.prototype.recalculatePane=function(a,b){a&&a.recalculate(b)};
|
|
D78.prototype.paneForSource=function(a){for(var b=this.m_panes.size()-1;0<=b;b--)if(this.m_panes.item(b).Z18().contains(a))return this.m_panes.item(b);return a instanceof D95?this.paneForSource(this.m_mainSeries):null};D78.prototype.recalculateAllPanes=function(){for(var a=0;a<this.m_panes.size();++a)this.m_panes.item(a).recalculate();this.timeScale().recalcLockedScale();this.updateAllPaneViews()};
|
|
D78.prototype._invalidateBarColorerCaches=function(){for(var a=this.Z18(),b=0;b<a.size();++b){var c=a.item(b);c instanceof TradingView.Series&&c.invalidateBarColorerCache()}};
|
|
D78.prototype.insertStudy=function(a,b,c){var d=null;TradingView.trackEvent("studies","Study_"+a.id);d=(c=c||D76.enabled("volume_force_overlay")&&"Volume@tv-basicstudies"==a.id)||a.is_price_study?this.paneForSource(this.m_mainSeries):this.createPane(void 0,!0);"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.Study.SCALE_RIGHT;e===TradingView.Study.SCALE_RIGHT?e=d.rightPriceScale():e===TradingView.Study.SCALE_LEFT?e=d.leftPriceScale():a.is_price_study?e=null:(console.warn("Cannot add study "+b.metaInfo().id+" with 'No Scale' setting, because study is not a price study. Using right price scale."),e=d.rightPriceScale());c?(d.addDataSource(b,
|
|
null),"Volume@tv-basicstudies"==a.id&&(a=b.priceScale(),a.setTopMargin(0.75),a.setBottomMargin(0))):d.addDataSource(b,e);b.properties().linkedToSeries&&b.properties().linkedToSeries.value()&&b.setOwnerSource(this.mainSeries());this.recalculatePane(d);this.Z19(new Q22(Q22.FULL_UPDATE));this._invalidateBarColorerCaches();this.recalcVisibleRangeStudy(this.Z18(),!0);return b};
|
|
D78.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.Z19(new Q22(Q22.FULL_UPDATE));return!1}};
|
|
D78.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),e=0;e<d.Z18().size();e++)if(d.Z18().item(e).metaInfo&&"Compare@tv-basicstudies"===d.Z18().item(e).metaInfo().id)return;this.m_mainSeries.priceScale().properties().percentage.setValue(!1)}this.Z19(new Q22(Q22.FULL_UPDATE));
|
|
this._invalidateBarColorerCaches();return c};
|
|
D78.prototype.move=function(a,b,c){var d=new List,e=this.children(a);d.append(a);d.appendAll(e);var f=this.paneForSource(a);this.panes().indexOf(f);f.state();f.priceScaleName(a.priceScale());this.panes().indexOf(b);b&&b.state();c=b?b.priceScaleName(c):"right";if(f===b)for(b.move(a,b.priceScaleByName(c)),d=a.priceScale(),a=0;a<e.size();a++)b.move(e.item(a),d);else{for(a=0;a<d.size();a++)this.detachSource(d.item(a));b=b?b:this.createPane();for(a=0;a<d.size();a++)b.addDataSource(d.item(a),b.priceScaleByName(c));
|
|
this.Z19(new Q22(Q7.FULL_UPDATE))}this.recalculateAllPanes()};D78.prototype.isSingleInstanceLineTool=function(a){return"LineStudyMtpRiskReward"==a||"LineStudyMtpAnalysis"==a?!0:!1};
|
|
D78.prototype.createLineTool=function(a,b,c,d){TradingView.trackEvent("GUI","Add Line Tool");var e=TradingView[c];if(!e)return null;this.isSingleInstanceLineTool(c)&&this._undoModel.removeAllDrawingTools(c);TradingView.trackEvent("drawings","Study_Drawing_"+c);d=new e(this,d);d.toolname=c;d.setOwnerSource(a.mainDataSource());e=a.defaultPriceScale();a.addDataSource(d,e);c=this.m_timeScale.indexToCoordinate(b.index);e=e.priceToCoordinate(b.price);d.isFixed()?b=d.addFixedPoint(new MathEx.Point(c,
|
|
e)):(b.price=this._magnet.align(b.price,b.index,a),b=d.addPoint(b));b||(this._lineBeingCreated=d,this._paneBeingCreatedLineOn=a);this.Z19(new Q22(Q22.FULL_UPDATE));return d};D78.prototype.lineBeingCreated=function(){return this._lineBeingCreated};D78.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn};
|
|
D78.prototype.coninueCreatingLine=function(a,b){var c=this.paneForSource(this._lineBeingCreated);c.defaultPriceScale();a.price=this._magnet.align(a.price,a.index,c);c=this._lineBeingCreated.addPoint(a,b);this._lineBeingCreated.updateAllViews();var d=new Q22(Q22.LIGHT_UPDATE);c&&(this._lineBeingCreated=this._paneBeingCreatedLineOn=null,d.force=!0);this.Z19(d);return c};
|
|
D78.prototype.cancelCreatingLine=function(){this._lineBeingCreated&&(this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire())};
|
|
D78.prototype.startChangingLinetool=function(a,b,c,d){this._lineBeingEdited=a;this._linePointBeingEdited=c;this._lineBeingEdited.startChanging(c,b);a=this.paneForSource(a);b.price=this._magnet.align(b.price,b.index,a);this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(c,b);this._lineBeingEdited.setPoint(c,b,d);this._lineBeingEdited.updateAllViews();b=this._paneInvalidationMask(a,Q22.LIGHT_UPDATE);b.force=!0;this.Z19(b)};
|
|
D78.prototype.lineBeingEdited=function(){return this._lineBeingEdited};D78.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited};
|
|
D78.prototype.changeLinePoint=function(a,b){var c=this.paneForSource(this._lineBeingEdited);if(void 0!==a.x&&void 0!==a.y){var 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)}else this._lineBeingEdited.setPoint(this._linePointBeingEdited,a,b);this._lineBeingEdited.updateAllViews();this.Z19(new Q22(Q22.LIGHT_UPDATE))};
|
|
D78.prototype.endChangingLinetool=function(){this.paneForSource(this._lineBeingEdited);this._lineBeingEdited.endChanging();this._linePointBeingEdited=this._lineBeingEdited=null;var a=new Q22(Q22.LIGHT_UPDATE);a.force=!0;this.Z19(a)};
|
|
D78.prototype.startMovingSource=function(a,b,c){this._sourceBeingMoved=a;this._linePointBeingMoved=c;this._sourceBeingMoved.startMoving(b,c);a=this.paneForSource(this._sourceBeingMoved);a=this._paneInvalidationMask(a,Q22.LIGHT_UPDATE);a.force=!0;this.Z19(a)};D78.prototype.sourceBeingMoved=function(){return this._sourceBeingMoved};
|
|
D78.prototype.moveSource=function(a){this._sourceBeingMoved.move(a,this._linePointBeingMoved);this.paneForSource(this._sourceBeingMoved);this.Z19(new Q22(Q22.LIGHT_UPDATE))};
|
|
D78.prototype.endMovingSource=function(){var a=this.paneForSource(this._sourceBeingMoved);this._sourceBeingMoved.endMoving();this._linePointBeingMoved=this._sourceBeingMoved=null;a=this._paneInvalidationMask(a,Q22.LIGHT_UPDATE);a.invalidateAll(Q22.LIGHT_UPDATE);a.force=!0;this.Z19(a)};D78.prototype.calculateDefaultTags=function(){for(var a=[],b=this.Z18(),c=0;c<b.size();c++){var d=b.item(c);d.tags&&(a=a.concat(d.tags()))}return a};
|
|
D78.prototype.changeZOrder=function(a,b){this.paneForSource(a).changeZOrder(a,b);this.Z19(new Q22(Q22.FULL_UPDATE))};D78.prototype.sendToBack=function(a){this.paneForSource(a).sendToBack(a);this.Z19(new Q22(Q22.FULL_UPDATE))};D78.prototype.bringToFront=function(a){this.paneForSource(a).bringToFront(a);this.Z19(new Q22(Q22.FULL_UPDATE))};
|
|
D78.prototype.onTagsChanged=function(){return this._tagsChanged};D78.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()};D78.prototype.setTimeViewport=function(a,b){this.timeScale().zoomToBarsRange(a,b);this.recalculateAllPanes();this.Z19(new Q22(Q22.LIGHT_UPDATE))};
|
|
D78.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.Z19(this._paneInvalidationMask(e,Q22.LIGHT_UPDATE))};D78.prototype.clearAllStudies=function(){for(var a=this.Z18(),b=0;b<a.size();b++)a.item(b).clearData&&a.item(b).clearData()};
|
|
D78.prototype.allLineTools=function(){for(var a=new List,b=this.m_panes,c=b.size(),d=0;d<c;++d)for(var e=b.item(d).Z18(),f=e.size(),g=0;g<f;++g){var h=e.item(g);isInherited(h.constructor,D46)&&a.append(h)}return a};D78.prototype.backgroundColor=function(){return this.Z1.paneProperties.background._value};D78.prototype.backgroundCounterColor=function(){return(new RGBColor(this.backgroundColor())).blackWhiteContrast()};
|
|
D78.prototype.isDark=function(){return"white"===this.backgroundCounterColor()};D78.prototype.canZoomIn=function(){return this.m_timeScale.canZoomIn()};D78.prototype.canZoomOut=function(){return this.m_timeScale.canZoomOut()};
|
|
D78.prototype.updateAllVolumeStudies=function(){for(var a=this.m_panes.toArray(),b=a.length;b--;)for(var c=!1,d=a[b],e=d.Z18().toArray(),f=e.length;f--;){var g=e[f];g instanceof TradingView.Study&&"Volume"===g.metaInfo().shortId&&(g.updateAllViews(),c||(this.updatePane(d),c=!0))}};
|
|
D78.prototype._prepareAlertsList=function(){var a=this;a.mainSeries().onSymbolResolved().subscribe(a,function(){function b(){(new Q68.SymbolToken(g.value())).exchange()&&TradingView.alertsDispatcher.requestList(function(b){for(;a._alertsList.size();)e(a._alertsList.item(0));for(var c=0;c<b.length;c++)d(b[c])},function(){},{symbol:g.value(),resolution:h.value(),activeOnly:!0})}function c(){for(var b=a._alertsList.toArray(),c=0;c<b.length;c++)e(b[c].id())}function d(b){var c=
|
|
a._alertsList.find(function(a){return a.id()===b.id()});c&&e(c);(b.active()||b.fake())&&g.value()===b.symbol()&&(a._alertsList.append(b),a._alertsList.onAdd.fire(b),a._alertsList.onChange.fire())}function e(b){var c=b instanceof TradingView.Alert?b.id():b.id||b;if(b=a._alertsList.find(function(a){return a.id()===c}))a._alertsList.removeAll(function(a){return a.id()===c}),a._alertsList.onRemove.fire(b),a._alertsList.onChange.fire()}function f(f){TradingView.alertsDispatcher.alertCreatingStarted[f](a,
|
|
d);TradingView.alertsDispatcher.alertRunning[f](a,d);TradingView.alertsDispatcher.alertDeletingStarted[f](a,e);TradingView.alertsDispatcher.alertDeletingAllStarted[f](a,c);TradingView.alertsDispatcher.alertDeleted[f](a,e);TradingView.alertsDispatcher.alertStoppingStarted[f](a,e);TradingView.alertsDispatcher.alertStoppingAllStarted[f](a,c);TradingView.alertsDispatcher.alertStopped[f](a,e);g[f](a,b);h[f](a,b)}var g=a.mainSeries().properties().symbol,h=a.mainSeries().properties().interval;loginStateChange.subscribe(a,
|
|
function(){is_authenticated?(b(),f("subscribe")):(c(),f("unsubscribe"))});is_authenticated&&(b(),f("subscribe"));a._alertsList.add=d;a._alertsList.remove=e},!0)};D78.prototype.alertsList=function(){return this._alertsList};D78.prototype._modelIntervals=[];D78.prototype.setInterval=function(a,b){var c=setInterval(a,b);this._modelIntervals.push(c);return c};
|
|
D78.prototype.clearInterval=function(a){clearInterval(a);a=this._modelIntervals.indexOf(a);-1<a&&this._modelIntervals.splice(a,1)};D78.prototype.clearIntervals=function(){for(var a=0;a<this._modelIntervals.length;a++)clearInterval(this._modelIntervals[a]);this._modelIntervals=[]};D78.prototype.destroy=function(){this.clearIntervals()};function DataWindowItem(a,b){this.m_title=a;this.m_value=b;this._visible=!0;this._color=void 0}DataWindowItem.prototype.title=function(){return this.m_title};DataWindowItem.prototype.text=function(){return this.m_value};DataWindowItem.prototype.visible=function(){return this._visible};DataWindowItem.prototype.color=function(){return this._color};DataWindowItem.prototype.setVisible=function(a){this._visible=a};DataWindowItem.prototype.setValue=function(a){this.m_value=a};
|
|
DataWindowItem.prototype.setColor=function(a){this._color=a};DataWindowItem.prototype.value=function(){return this.m_value};function DataWindowView(){this._title=this._header="";this._items=new List}DataWindowView.prototype.header=function(){return this._header};DataWindowView.prototype.title=function(){return this._title};DataWindowView.prototype.items=function(){return this._items};function StatusView(a){this._props=a;this._text="";this._size="12px";this._bold=!1}StatusView.prototype.text=function(){return this._text};StatusView.prototype.color=function(){return this._props?this._props.scalesProperties.textColor.value():"#444"};StatusView.prototype.bold=function(){return this._bold};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 RGBColor(this._background)).blackWhiteContrast()};PriceAxisView.prototype.coordinate=function(){return this._coordinate};function PriceAxisViewRenderer(a){this._data=a;this._data.borderColor||(this._data.borderColor=this._data.background)}
|
|
PriceAxisViewRenderer.prototype.draw=function(a,b,c,d){function e(a,b,c,d){$.browser.webkit?d-=1:$.browser.mozilla?d+=1:$.browser.jsdom&&(d+=0.5);a.fillText(b,c,d)}if(this._data.visible){if(this._data.font){var f=a.font;a.font=this._data.font}var g=a.measureText(this._data.text||this._data.secondLine).width;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-0.5*d)-0.5,l=k,m=l+d+1,q=
|
|
m;if(this._data.text){if(b){var n=c-1.5,t=n-g-9-2,u=t,z=c=n,s=z-3;a.beginPath();a.moveTo(n,k);a.lineTo(t,l);a.lineTo(u,m);a.lineTo(c,q);a.fill();a.beginPath();a.strokeStyle=this._data.color;a.moveTo(z,h);a.lineTo(s,h);a.stroke();a.textBaseline="middle";a.textAlign="left";a.fillStyle=this._data.color;z=n-g-0.4*d}else n=0.5,u=t=n+g+9+2,z=c=n,s=z+3,a.beginPath(),a.moveTo(n,k),a.lineTo(t,l),a.lineTo(u,m),a.lineTo(c,q),a.fill(),a.beginPath(),a.strokeStyle=this._data.color,a.moveTo(z,h),a.lineTo(s,h),a.stroke(),
|
|
a.textBaseline="middle",a.textAlign="left",a.fillStyle=this._data.color,z=n+0.4*d;e(a,this._data.text,z,h+1);this._data.font&&(a.font=f)}this._data.secondLine&&(f=a.measureText(this._data.secondLine).width,a.fillStyle=this._data.background,this._data.text&&(k=m+1,l=q+1,m=k+d,q=l+d),b?(c=n=n-g-9-2,t=n+f+4+3):(c=n=0.5+g-f+4,t=g+9+2+0.5),u=t,z=n+2,a.beginPath(),a.moveTo(n,k),a.lineTo(t,l),a.lineTo(u,m),a.lineTo(c,q),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,z,b))}};function TimeAxisView(){this._text="";this._background="#585858";this._coordinate=0}TimeAxisView.prototype.text=function(){return this._text};TimeAxisView.prototype.background=function(){return this._background};TimeAxisView.prototype.color=function(){return(new RGBColor(this._background)).blackWhiteContrast()};TimeAxisView.prototype.coordinate=function(){return this._coordinate};function TimeAxisViewRenderer(a){this._data=a}
|
|
TimeAxisViewRenderer.prototype.draw=function(a,b,c){if(!1!==this._data.visible&&(b=a.measureText(this._data.text).width,!(0>=b))){c=b+6;b=Math.round(this._data.coordinate-0.5*c-1.5)+1.5;c=b+c+3;var d=Math.round(this._data.coordinate+1),e=this._data.textHeight+6+0.5;a.fillStyle=this._data.background;a.lineWidth=1;a.beginPath();a.moveTo(b,0.5);a.lineTo(b,e);a.lineTo(c,e);a.lineTo(c,0.5);a.fill();a.strokeStyle=this._data.color;a.beginPath();a.moveTo(d,0.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,0.5*(0.5+e)+1):a.fillText(this._data.text,b+3+1,0.5*(0.5+e)+2)}};function CrossHair(a,b){var c=this;DataSource.call(this);this.Z1=b;this.D99=a;this._dataWindowView=new CrossHairDataWindowView(this,a);this._priceAxisView=new CrossHairPriceAxisView(this,a);this._startMeasurePriceAxisView=new CrossHairPriceAxisView(this,a,"measureStartY");this._endMeasurePriceAxisView=new CrossHairPriceAxisView(this,a,"measureEndY");this._timeAxisView=new CrossHairTimeAxisView(this,a);this._startMeasureTimeAxisView=new CrossHairTimeAxisView(this,a,"measureStartX");this._endMeasureTimeAxisView=
|
|
new 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(CrossHair,DataSource);CrossHair.prototype.index=0;CrossHair.prototype.price=NaN;CrossHair.prototype.pane=null;CrossHair.prototype.color="white";CrossHair.prototype.style="";CrossHair.prototype.properties=function(){return this.Z1};
|
|
CrossHair.prototype.setPosition=function(a,b,c){this._subscribed||(this.D99.mainSeries().onRestarted().subscribe(this,CrossHair.prototype.clearMeasure),this._subscribed=!0);this.index=a;this.x=this.D99.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()};
|
|
CrossHair.prototype.clearPosition=function(){this.visible=!1;this.index=parseInt(this.D99.mainSeries().data().bars().last())};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)};CrossHair.prototype.measureStartX=function(){return this.D99.timeScale().indexToCoordinate(this._startMeasurePoint.index)};
|
|
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)};CrossHair.prototype.measureEndX=function(){return this.D99.timeScale().indexToCoordinate(this._endMeasurePoint.index)};
|
|
CrossHair.prototype.paneViews=function(a){var b=(new List).append(new W64(this,a,a===this.pane));a===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new W63(this,a)),this._measurePaneView.update(),b.append(this._measurePaneView));return b};CrossHair.prototype.dataWindowView=function(){return this._dataWindowView};
|
|
CrossHair.prototype.priceAxisViews=function(a,b){if(this.visible&&this.pane===a&&b===a.defaultPriceScale()){var c=new List;c.append(this._priceAxisView);this._startMeasurePoint&&c.append(this._startMeasurePriceAxisView);this._endMeasurePoint&&c.append(this._endMeasurePriceAxisView);return c}return null};
|
|
CrossHair.prototype.timeAxisView=function(){if(!this.visible)return null;var a=new List;a.append(this._timeAxisView);this._startMeasurePoint&&a.append(this._startMeasureTimeAxisView);this._endMeasurePoint&&a.append(this._endMeasureTimeAxisView);return a};
|
|
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()};CrossHair.prototype.startMeasurePoint=function(){return this._startMeasurePoint};
|
|
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};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};
|
|
CrossHair.prototype.endMeasurePoint=function(){return this._endMeasurePoint};CrossHair.prototype.clearMeasure=function(a){delete this._measurePane;delete this._startMeasurePoint;delete this._endMeasurePoint;delete this._lastValidMeasurePoint;this.D99.Z19(new Q22(Q22.LIGHT_UPDATE))};
|
|
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};CrossHair.prototype.currentPoint=function(){return new MathEx.Point(this.x,this.y)};function W63(a,b){this.D98=a;this._pane=b;this._rendererCache={}}
|
|
W63.prototype.update=function(){if(this.D98._endMeasurePoint)var a=this.D98._endMeasurePoint.price,b=this.D98._endMeasurePoint.index;else if(this.D98._measurePane===this.D98.pane)a=this.D98.price,b=this.D98.index;else if(this.D98._lastValidMeasurePoint)a=this.D98._lastValidMeasurePoint.rawPrice,b=this.D98._lastValidMeasurePoint.index;else return;var c=a-this.D98._startMeasurePoint.price,d=b-this.D98._startMeasurePoint.index,
|
|
e=this.D98._startMeasurePoint.price,f=this.D98._measurePane;if(f.defaultPriceScale().isPercent()){var g=f.mainDataSource().firstValue();this.D98._endMeasurePoint&&(a=f.defaultPriceScale().priceRange().convertToPercent(a,g));e=f.defaultPriceScale().priceRange().convertToPercent(e,g)}this._horzLabel=$.t("{0} bars").format(d);d=this.D98._measurePane.defaultPriceScale().formatter().format(c);this.D98._startMeasurePoint.price&&(f=c/this.D98._startMeasurePoint.price,d+=" ("+(new PercentageFormatter).format(100*
|
|
f)+")");this._vertLabel=""+d;e=this.D98.D99._magnet.align(e,this.D98._startMeasurePoint.index,this.D98._measurePane);a=this.D98.D99._magnet.align(a,b,this.D98._measurePane);d=this.D98.D99.timeScale().indexToCoordinate(this.D98._startMeasurePoint.index);f=this.D98.D99.timeScale().indexToCoordinate(b);e=this.D98._measurePane.defaultPriceScale().priceToCoordinate(e);a=this.D98._measurePane.defaultPriceScale().priceToCoordinate(a);this._p1=new MathEx.Point(d,
|
|
e);this._p2=new MathEx.Point(f,a);a=this.D98.D99.timeScale().indexToUserTime(this.D98._startMeasurePoint.index);b=this.D98.D99.timeScale().indexToUserTime(b);a&&b&&(b=(b.valueOf()-a.valueOf())/1E3,this._horzLabel+=", "+(new TimeSpanFormatter).format(b));if(b=this.D98._measurePane.mainDataSource().base())c=Math.round(c*b),this._vertLabel+=" , "+c};
|
|
W63.prototype.renderer=function(){var a=new CompositeRenderer,b={};b.points=(new List).append(this._p1).append(this._p2);b.width=this.D98.D99.timeScale().width();b.height=this.D98._measurePane.defaultPriceScale().height();b.color="#D3E7FF";b.linewidth=0;b.fillBackground=!0;b.transparency=60;b.backcolor="#BADAFF";a.append(new RectangleRenderer(b));var c=this._p1.add(this._p2).scaled(0.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:D46.LINEEND_NORMAL,rightend:D46.LINEEND_ARROW};a.append(new 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:D46.LINEEND_NORMAL,
|
|
rightend:D46.LINEEND_ARROW};a.append(new TrendLineRenderer(d));b=function(a,b){return{points:(new List).append(b),text:a,color:"#FFFFFF",horzAlign:"center",vertAlign:"middle",font:"Arial",offsetX:5,offsetY:0,bold:!1,italic:!1,fontsize:12,highlightBorder:!1,backgroundColor:"#646668",backgroundTransparency:20,backgroundVertInflate:5,backgroundHorzInflate:5}};c=c.add(new MathEx.Point(0,-10));c=b(this._horzLabel,c);a.append(new TextRenderer(c,this._rendererCache));c=this._p2.y;this._p1.y>this._p2.y&&
|
|
(c-=27);c=new MathEx.Point(0.5*(this._p1.x+this._p2.x),c);c=b(this._vertLabel,c);a.append(new TextRenderer(c,this._rendererCache));return a};function W64(a,b,c){this.source=a;this.pane=b;this._horzVisible=c}W64.prototype.update=function(){};
|
|
W64.prototype.renderer=function(){var a={},b=this.source.visible&&this.source.areLinesVisible;a.horzLinesVisible=b&&this._horzVisible;a.vertLinesVisible=b;var c=(b=this.pane.D99.readOnly())?defaults("chartproperties.paneProperties.crossHairProperties"):null,d=TradingView.isMobile.any()&&D46.isLineTool(this.source.D99.currentTool()),e=d?"#a000a0":b?c.color:this.pane.D99.properties().paneProperties.crossHairProperties.color.value(),f=b?c.transparency:this.pane.D99.properties().paneProperties.crossHairProperties.transparency.value();
|
|
!d&&0<f&&(e=generateColor(e,f));a.color=e;a.lineWidth=b?c.width:this.pane.D99.properties().paneProperties.crossHairProperties.width.value();a.lineStyle=b?c.style:this.pane.D99.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=this.source.x;a.y=this.source.y;return new D61(a)};function D61(a){this.data=a}
|
|
D61.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?0.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())}};function CrossHairPriceAxisView(a,b){this._crossHair=a;this.D99=b;this._rendererData={background:"#585858",color:"white",textHeight:14,visible:!0};this._defaultFormatter=new PriceFormatter(100)}inherit(CrossHairPriceAxisView,PriceAxisView);
|
|
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()}};CrossHairPriceAxisView.prototype.renderer=function(){this._renderer||(this._renderer=new PriceAxisViewRenderer(this._rendererData));return this._renderer};function CrossHairTimeAxisView(a,b){TimeAxisView.call(this);this._crosshair=a;this.D99=b;this._rendererData={visible:!1,background:"#585858",color:"white",textHeight:14,text:""}}inherit(CrossHairTimeAxisView,TimeAxisView);
|
|
CrossHairTimeAxisView.prototype.update=function(){var a=this._rendererData;this.D99.timeScale();a.coordinate=this._crosshair.x;var b=this.D99.timeScale().indexToUserTime(this._crosshair.index);b?(a.visible=!0,a.text=(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(b)):(a.visible=!1,a.text="")};CrossHairTimeAxisView.prototype.renderer=function(){var a=this._rendererData;this._renderer||(this._renderer=new TimeAxisViewRenderer(a));return this._renderer};function CrossHairDataWindowView(a,b){DataWindowView.call(this);this._header=null;this._crossHair=a;this.D99=b;this._items.append(new DataWindowItem("Date",""));this._items.append(new DataWindowItem("Time",""));this._items.append(new DataWindowItem("Price",""));this._defaultFormatter=new PriceFormatter(100)}inherit(CrossHairDataWindowView,DataWindowView);
|
|
CrossHairDataWindowView.prototype.update=function(){var a=this.D99.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.D99.timeScale().isEmpty()){var b=this._crossHair.index,b=this.D99.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 DateFormatter).format(b)),a||this._items.item(1).setValue((new 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)))}};function MAMetaInfo(){return new 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:{}})}
|
|
function VolumeMetaInfo(){return new 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"}}}}})}
|
|
function DMMetaInfo(){return new 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:{}})}
|
|
function RSIMetaInfo(){return new 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:{}})}function makeDefaultChartModel(a,b,c,d,e,f,g,h){a=new D77(a,b,c,d,e,f,g,h);a.model().Z19(new Q22(Q22.FULL_UPDATE));return a};function Grid(){this.horzLinesVisible=this.visible=!0;this.horzLinesColor="white";this.horzLinesStyle="";this.vertLinesVisible=!0;this.vertLinesColor="white";this.vertLinesStyle=""}Grid.prototype.paneViews=function(a){return(new List).append(new W82(this,a))};function W82(a,b){this.source=a;this.pane=b}W82.prototype.update=function(){};
|
|
W82.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.D99.properties().paneProperties.gridProperties.color.value();a.vertLinesColor=a.horzLinesColor;a.lineStyle=this.pane.D99.properties().paneProperties.gridProperties.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 D64(a)};function D64(a){this.data=a}
|
|
D64.prototype.draw=function(a){CanvasEx.setLineStyle(a,this.data.lineStyle);var b=a.lineStyle!=CanvasEx.LINESTYLE_SOLID&&!("setLineDash"in a||"mozDash"in a||"webkitLineDash"in a),c=b?CanvasEx.computeDashPattern(a):null,d;a.translate(1,0);a.lineWidth=1;if(this.data.vertLinesVisible){a.strokeStyle=this.data.vertLinesColor;a.beginPath();for(d=0;d<this.data.timeMarks.length;d++)b?a.dashedLineTo(this.data.timeMarks[d].coord,0,this.data.timeMarks[d].coord,this.data.h,c):(a.moveTo(this.data.timeMarks[d].coord,
|
|
0),a.lineTo(this.data.timeMarks[d].coord,this.data.h));a.closePath();a.stroke()}if(this.data.horzLinesVisible){a.strokeStyle=this.data.horzLinesColor;a.beginPath();for(d=0;d<this.data.priceMarks.length;d++)b?a.dashedLineTo(0,this.data.priceMarks[d].coord,this.data.w,this.data.priceMarks[d].coord,c):(a.moveTo(0,this.data.priceMarks[d].coord),a.lineTo(this.data.w,this.data.priceMarks[d].coord));a.closePath();a.stroke()}};function Watermark(a){function b(){var b=c.width(),d=c.height();return{draw:function(c){var l=a.symbolInfo();if(l){c.fillStyle=f.color.value();var m=(100-f.transparency.value())/100;if(0!==m){c.globalAlpha=m;for(var l=[{text:l.name?l.name+", "+translatedIntervalString(a.interval()):"",font:"96px Verdana, Arial, sans-serif",lineHeight:114,baselineOffset:87},{text:l.description||"",font:"48px Verdana, Arial, sans-serif",lineHeight:57,baselineOffset:43.5}],q=m=0;q<l.length;q++){var n=l[q];if(n.text){c.font=
|
|
n.font;var t=c,u=n.text,z=t.font;e.hasOwnProperty(z)||(e[z]={});textWidth=e[z].hasOwnProperty(u)?e[z][u]:e[z][u]=t.measureText(u).width;textWidth>b?(n.zoom=b/textWidth,textWidth=b):n.zoom=1;n.offsetLeft=(b-textWidth)/2;m+=n.lineHeight*n.zoom}}m=Math.max((d-m)/2,0);for(q=0;q<l.length;q++)n=l[q],n.text&&(c.save(),c.font=n.font,c.translate(n.offsetLeft,m),c.scale(n.zoom,n.zoom),c.fillText(n.text,0,n.baselineOffset),c.restore(),m+=n.lineHeight*n.zoom)}}}}}var c=null,d=new Function,e={},f=a.model().properties().symbolWatermarkProperties;
|
|
this.paneViews=function(a){if(!a.containsMainSeries())return new List;c=a;return(new List).append({renderer:b,update:d})}};function Legend(){this.m_items=new List}Legend.prototype.items=function(){return this.m_items};function LegendItem(a,b){this.m_title=b;this.m_color="white";this.m_dataSource=a}LegendItem.prototype.title=function(){return this.m_title};LegendItem.prototype.color=function(){return this.m_color};LegendItem.prototype.dataSource=function(){return this.m_dataSource};function D74(a,b,c){var d=this;this.m_timeScale=a;a=b.rightAxisProperties.state();a.autoScale=!0;this.m_rightPriceScale=new D75(new Property(a));this.m_rightPriceScale.properties().percentage.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.Z19(new Q22(Q22.LIGHT_UPDATE))});this.m_rightPriceScale.properties().log.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.Z19(new Q22(Q22.LIGHT_UPDATE))});
|
|
a=b.leftAxisProperties.state();a.autoScale=!0;this.m_leftPriceScale=new D75(new Property(a));this.m_leftPriceScale.properties().log.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.Z19(new Q22(Q22.LIGHT_UPDATE))});this.m_leftPriceScale.properties().percentage.listeners().subscribe(null,function(){d._needRecalc=!0;d._recalculateImpl();c.Z19(new Q22(Q22.LIGHT_UPDATE))});
|
|
this.m_dataSources=new List;this.m_legend=new Legend;this.m_width=this.m_height=0;this.m_mainDataSource=null;this.Z1=b;this.D99=c;this._tagsChanged=new Delegate;b.topMargin.listeners().subscribe(this,D74.prototype._updateMargins);b.bottomMargin.listeners().subscribe(this,D74.prototype._updateMargins);this._updateMargins();this._stretchFactor=D74.DEFAULT_STRETCH_FACTOR}D74.DEFAULT_STRETCH_FACTOR=1E3;D74.PANE_ANIMATION_DURATION=500;
|
|
D74.alwaysTopSources=["LineToolOrder","LineToolPosition","LineToolExecution"];D74.sortSourcesPreOrdered={"Volume@tv-basicstudies":0,"Script$TV_DIVIDENDS@tv-scripting":1,"Script$TV_SPLITS@tv-scripting":2,"Script$TV_EARNINGS@tv-scripting":3};
|
|
D74.sortSources=function(a){a.sort(function(a,b){if(0<=D74.alwaysTopSources.indexOf(a._constructor))return 1;if(0<=D74.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 D74.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=D74.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};
|
|
D74.prototype._updateMargins=function(){var a=0.01*this.Z1.topMargin.value(),b=0.01*this.Z1.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.size();c++){var d=this.m_dataSources.item(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()};D74.prototype.model=function(){return this.D99};D74.prototype.width=function(){return this.m_width};D74.prototype.height=function(){return this.m_height};D74.prototype.setWidth=function(a){this.m_width=a;this.updateAllViews()};
|
|
D74.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.size();b++){var c=this.m_dataSources.item(b);this.isOverlay(c)&&c.priceScale()&&c.priceScale().setHeight(a)}this.updateAllViews()};D74.prototype.leftPriceScale=function(){return this.m_leftPriceScale};D74.prototype.rightPriceScale=function(){return this.m_rightPriceScale};D74.prototype.timeScale=function(){return this.m_timeScale};
|
|
D74.prototype.Z18=function(){return this.m_dataSources};D74.prototype.isOverlay=function(a){return a._isOverlay};D74.prototype.legend=function(){return this.m_legend};
|
|
D74.prototype._processMainSourceChange=function(){var a;if(null===this.m_mainDataSource)for(var b=0;b<this.m_dataSources.size();b++){var c=this.m_dataSources.item(b);if(isInherited(c.constructor,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.size();b++)c=this.m_dataSources.item(b),isInherited(c.constructor,
|
|
D46)&&a.push(c);a=D74.sortSources(a);for(b=0;b<a.length;b++)this.move(a[b],this.m_mainDataSource.priceScale())}else if(!this.m_mainDataSource)for(b=0;b<this.m_dataSources.size();b++)if(c=this.m_dataSources.item(b),isInherited(c.constructor,PriceDataSource)&&this.isOverlay(c)&&c.showInObjectTree()){this.m_mainDataSource=c;this.m_rightPriceScale.addDataSource(c);c.setPriceScale(this.m_rightPriceScale);for(var b=this.D99.children(c),d=0;d<b.size();d++)a=b.item(d),this.m_rightPriceScale.addDataSource(a),
|
|
a.setPriceScale(this.m_rightPriceScale);this.recalculatePriceScale(this.m_rightPriceScale);c._isOverlay=!1;break}};
|
|
D74.prototype.addDataSource=function(a,b){this.m_dataSources.append(a);var c=!1;null!==this.m_mainDataSource||a instanceof TradingView.AlertLabel||(this.m_mainDataSource=a,c=!0);a._isOverlay=!1;null===b&&(b=new D75(new Property(this.Z1.overlayPropreties.state())),b.setHeight(this.m_height),b.setTopMargin(this.m_rightPriceScale.topMargin()),b.setBottomMargin(this.m_rightPriceScale.bottomMargin()),a._isOverlay=!0);b.addDataSource(a);a.setPriceScale(b);a.onTagsChanged&&a.onTagsChanged().subscribe(this,
|
|
D74.prototype.onSourceTagsChanged);a.setZorder(this.getZOrderMinMax().minZOrder-1);c&&this._processMainSourceChange();a instanceof TradingView.AlertLabel||this.updateAlertLabelsSources();this._tagsChanged.fire();isInherited(a.constructor,PriceDataSource)&&this.recalculatePriceScale(b);this.invalidateSourcesCache()};
|
|
D74.prototype.removeDataSource=function(a,b){if(this.m_dataSources.contains(a)){a._isOverlay=!1;this.m_dataSources.remove(a);a!==this.m_mainDataSource||b||(this.m_mainDataSource=null);var c=null;this.m_leftPriceScale.Z18().contains(a)?(this.m_leftPriceScale.removeDataSource(a),c=this.m_leftPriceScale):this.m_rightPriceScale.Z18().contains(a)&&(this.m_rightPriceScale.removeDataSource(a),c=this.m_rightPriceScale);a.onTagsChanged&&a.onTagsChanged().unsubscribe(this,D74.prototype.onSourceTagsChanged);
|
|
isInherited(a.constructor,PriceDataSource)&&this._processMainSourceChange();a instanceof TradingView.AlertLabel||this.D99.mainSeries()!==a||this.updateAlertLabelsSources();this._tagsChanged.fire();c&&isInherited(a.constructor,PriceDataSource)&&this.recalculatePriceScale(c);this.invalidateSourcesCache()}else TradingView.logDebug("removeDataSource: invalid data source")};
|
|
D74.prototype.updateAlertLabelsSources=function(){for(var a=this.containsMainSeries(),b=this.D99.alertsList(),c=new List($.grep(this.Z18().toArray(),function(a){return a instanceof TradingView.AlertLabel})),d=b.size()-1;0<=d;d--){var e=b.item(d),f=c.find(function(a){return a.id()===e.id()});if(!f&&(a||!e.isOHLC())){var g=new TradingView.AlertLabel(this.D99,e),h=this.rightPriceScale()||this.leftPriceScale();this.addDataSource(g,h)}f&&!a&&e.isOHLC()&&this.removeDataSource(new TradingView.AlertLabel(f))}};
|
|
D74.prototype.startScalePrice=function(a,b){a.startScale(b)};D74.prototype.scalePriceTo=function(a,b){a.scaleTo(b);this.updateAllViews()};D74.prototype.endScalePrice=function(a){a.endScale()};D74.prototype.startScrollPrice=function(a,b){a.startScroll(b)};D74.prototype.scrollPriceTo=function(a,b){a.scrollTo(b);this.updateAllViews()};D74.prototype.endScrollPrice=function(a){a.endScroll()};
|
|
D74.prototype.setPriceAutoScale=function(a,b){a.setAutoScale(b);this.timeScale().isEmpty()?a.setPriceRange(null):this.recalculatePriceScale(a)};D74.prototype.restorePriceScaleState=function(a,b){a.restoreState(b);this.updateAllViews()};D74.prototype.updateAllViews=function(){for(var a=0;a<this.Z18().size();a++)this.Z18().item(a).updateAllViews()};
|
|
D74.prototype.defaultPriceScale=function(){if(!this.m_mainDataSource)var a=this.rightPriceScale();this.m_mainDataSource&&(a=this.m_mainDataSource.priceScale());void 0==a&&(props=new Property(this.Z1.overlayPropreties.state()),a=new D75(props));return a};D74.prototype._priceScaleIsPrice=function(a){return(a=a.mainSource())?isInherited(a.constructor,TradingView.Series)?!0:isInherited(a.constructor,TradingView.Study)?a.metaInfo().is_price_study:!1:!1};
|
|
D74.prototype.findSuitableScale=function(a){var b=!1;isInherited(a.constructor,TradingView.Study)?b=a.metaInfo().is_price_study: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};
|
|
D74.prototype.mainDataSource=function(){return this.m_mainDataSource};D74.prototype.recalculatePriceScale=function(a){if(a){if(a.isAutoScale()&&!this.timeScale().isEmpty()){var b=this.timeScale().visibleBars();a.recalculatePriceRange(b)}a.updatePaneViews()}};D74.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()};
|
|
D74.prototype._recalculateImpl=function(){if(this._needRecalc){this.recalculatePriceScale(this.m_rightPriceScale);this.recalculatePriceScale(this.m_leftPriceScale);for(var a=0;a<this.m_dataSources.size();a++){var b=this.m_dataSources.item(a);this.isOverlay(b)&&this.recalculatePriceScale(b.priceScale())}this.updateAllViews();this.D99.updatePane(this);this._needRecalc=!1}};D74.prototype.recalculate=function(a){this._needRecalc=!0;a&&this._recalculateImpl()};
|
|
D74.prototype.isEmpty=function(){return null===this.m_mainDataSource};D74.prototype.move=function(a,b){var c=this.m_dataSources.clone();this.removeDataSource(a,null!==b);this.addDataSource(a,b);this.m_dataSources=c;this.invalidateSourcesCache()};D74.prototype.dataSourceForId=function(a){for(var b=0;b<this.m_dataSources.size();b++)if(this.m_dataSources.item(b).id()===a)return this.m_dataSources.item(b);return null};
|
|
D74.prototype.priceScaleForSource=function(a){return this.rightPriceScale().Z18().contains(a)?this.rightPriceScale():this.leftPriceScale().Z18().contains(a)?this.leftPriceScale():null};D74.prototype.sourceById=function(a){for(var b=0;b<this.m_dataSources.size();b++)if(this.m_dataSources.item(b).id()===a)return this.m_dataSources.item(b);return null};D74.prototype.containsMainSeries=function(){return this.m_dataSources.contains(this.D99.mainSeries())};
|
|
D74.prototype.priceScaleByName=function(a){return"left"===a?this.m_leftPriceScale:"right"===a?this.m_rightPriceScale:null};D74.prototype.priceScaleName=function(a){return a===this.m_leftPriceScale?"left":a===this.m_rightPriceScale?"right":""};
|
|
D74.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];isInherited(e.constructor,D46)?b.push(e):c.push(e)}return this._cachedHitTestSources=c.concat(b)};
|
|
D74.prototype.orderedSources=function(){if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(var a=[],b=0,c=this.Z18().size();b<c;b++){var d=this.Z18().item(b);isInherited(d.constructor,D46)&&!d.isActualSymbol()||a.push(d)}return this._cachedOrderedSoruces=a=D74.sortSources(a)};D74.prototype.invalidateSourcesCache=function(){this._cachedHitTestSources=this._cachedOrderedSoruces=null;this.m_leftPriceScale.invalidateSourcesCache();this.m_rightPriceScale.invalidateSourcesCache()};
|
|
D74.prototype.getZOrderMinMax=function(){for(var a=this.orderedSources(),b=Number.MAX_VALUE,c=-Number.MAX_VALUE,d=0;d<a.length;d++){var e=a[d];e.showInObjectTree()&&(e.zorder()<b&&(b=e.zorder()),e.zorder()>c&&(c=e.zorder()))}return{minZOrder:b,maxZOrder:c}};D74.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)};
|
|
D74.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)};D74.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()};
|
|
D74.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()};D74.prototype.onTagsChanged=function(){return this._tagsChanged};D74.prototype.dumpPriceScale=function(a){for(var b=new List,c=a.Z18().clone(),d=0;d<c.size();++d){var e=c.item(d).priceAxisViews(this,a);e&&b.appendAll(e)}a=[];for(d=0;d<b.size();d++)a.push(b.item(d).dump());return a};
|
|
D74.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};D74.prototype.clearSeries=function(){for(var a=this.m_dataSources.size()-1;0<=a;a--)isInherited(this.m_dataSources.item(a).constructor,TradingView.Series)&&this.m_dataSources.removeAt(a)};
|
|
D74.prototype.actionNoScaleIsEnabled=function(a){return this.isOverlay(a)||!isInherited(a.constructor,PriceDataSource)?!0:1<this.Z18().count(function(a){return a.properties().linkedToSeries&&a.properties().linkedToSeries.value()?!1:isInherited(a.constructor,PriceDataSource)&&a.showInObjectTree()&&!a.isNoScale()})};
|
|
D74.prototype.executionsPositionController=function(){this._executionsPositionController||(this._executionsPositionController=new ExecutionsPositionController(this,this.D99.timeScale()));return this._executionsPositionController};function optimalBarWidth(a){return 0.3*a}function selectionTolerance(a){return 2+0.5*a}function paneRendererCoordinateIsValid(a){return null!==a&&void 0!==a&&!isNaN(a)}function D55(a){this.bars=a.bars;this.barSpacing=a.barSpacing;this.barWidth=optimalBarWidth(a.barSpacing);this.barLineWidth=Math.max(1,Math.round(this.barWidth));this.dontDrawOpen=a.dontDrawOpen}
|
|
D55.prototype.draw=function(a){a.save();a.translate(0.5,0.5);for(var b,c=0;c<this.bars.size();++c){var d=this.bars.item(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()};D55.prototype.hitTest=function(a){var b=this.bars,c=0.5*this.barSpacing;if(b.isEmpty()||a.x<b.first().time-c||a.x>b.last().time+c)return null;for(var d=null,e=0;e<b.size();++e){var f=b.item(e);if(a.x<=f.time+c){d=f;break}}b=selectionTolerance(this.barLineWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new HitTestResult(HitTestResult.REGULAR):null};
|
|
function D69(a){this.bars=a.bars;this.barWidth=a.barWidth;this.barLineWidth=1}
|
|
D69.prototype.draw=function(a){a.save();a.lineCap="butt";a.translate(0.5,0.5);a.lineWidth=this.barLineWidth;for(var b=this.barWidth/2,c=0,d;c<this.bars.size();++c){d=this.bars.item(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()};
|
|
D69.prototype.hitTest=function(a){var b=this.bars,c=0.5*this.barWidth;if(b.isEmpty()||a.x<b.first().time-c||a.x>b.last().time+c)return null;for(var d=null,e=0;e<b.size();++e){var f=b.item(e);if(a.x<=f.time+c){d=f;break}}b=selectionTolerance(this.barLineWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new HitTestResult(HitTestResult.REGULAR):null};function D66(a){this.bars=a.bars;this.barSpacing=a.barSpacing;this.barLineWidth=Math.max(1,optimalBarWidth(a.barSpacing))}
|
|
D66.prototype.draw=function(a){a.save();a.lineCap="square";a.translate(0.5,0.5);for(var b=0;b<this.bars.size();++b){var c=this.bars.item(b),d=Math.round(0.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()};
|
|
D66.prototype.hitTest=function(a){var b=this.bars,c=0.5*this.barLineWidth;if(b.isEmpty()||a.x<b.first().time-c||a.x>b.last().time+c)return null;for(var d=null,e=0;e<b.size();++e){var f=b.item(e);if(a.x<=f.time+c){d=f;break}}b=selectionTolerance(0.5*this.barLineWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new HitTestResult(HitTestResult.REGULAR):null};function D68(a){this.bars=a.bars;this.barSpacing=a.barSpacing;this.blockSize=a.blockSize;this.barWidth=a.barSpacing}
|
|
D68.prototype.draw=function(a){a.save();a.lineCap="butt";a.translate(0.5,0.5);for(var b=0;b<this.bars.size();++b){bar=this.bars.item(b);var c=(bar.low-bar.high)/bar.additionalNum;a.beginPath();for(var d=0;d<bar.additionalNum;d++)bar.isUp?(a.moveTo(Math.round(bar.time-0.5*this.barWidth)+0.5,bar.high+d*c),a.lineTo(Math.round(bar.time+0.5*this.barWidth)-0.5,bar.high+(d+1)*c),a.moveTo(Math.round(bar.time+0.5*this.barWidth)-0.5,bar.high+d*c),a.lineTo(Math.round(bar.time-0.5*this.barWidth)+
|
|
0.5,bar.high+(d+1)*c)):this.drawEllipse(a,bar.time-0.45*this.barWidth+0.5,bar.high+d*c,Math.round(0.9*this.barWidth),Math.round(c));a.strokeStyle=bar.color;a.lineWidth=1;a.stroke()}a.restore()};D68.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,0.95,0,2*Math.PI,!1);a.restore()};
|
|
D68.prototype.hitTest=function(a){var b=this.bars,c=0.5*this.barSpacing;if(b.isEmpty()||a.x<b.first().time-c||a.x>b.last().time+c)return null;for(var d=null,e=0;e<b.size();++e){var f=b.item(e);if(a.x<=f.time+c){d=f;break}}b=selectionTolerance(this.barWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new HitTestResult(HitTestResult.REGULAR):null};
|
|
function D65(a){this.items=a.items;this.barSpacing=a.barSpacing;this.histogramBase=a.histogramBase;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth}D65.prototype.draw=function(a){a.translate(0.5,0.5);a.fillStyle=this.lineColor;for(var b=this.lineWidth,c=0;c<this.items.size();++c){var d=this.items.item(c),e=d.x,f=d.y;d.style&&(a.fillStyle=d.style.color,b=d.style.width);a.fillRect(Math.round(e-0.5*b),f,b,this.histogramBase-f)}};
|
|
D65.prototype.hitTest=function(a){for(var b=selectionTolerance(this.lineWidth),c,d,e=0;e<this.items.size();++e)if(c=this.items.item(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 HitTestResult(HitTestResult.REGULAR);return null};
|
|
function D59(a){this.items=a.items;this.barSpacing=a.barSpacing;this.histogramBase=a.histogramBase;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth}
|
|
D59.prototype.draw=function(a){if(0!==this.items.size()){a.translate(0.5,0.5);for(var b=Math.round(this.items.item(0).x-0.5*this.barSpacing),c="",d=0;d<this.items.size();++d){var e=this.items.item(d),b=Math.ceil(e.x-0.5*this.barSpacing),f=Math.ceil(b+this.barSpacing),g=e.y;if(1>this.barSpacing){if(e.style)c!==e.style.color&&(c=a.fillStyle=e.style.color);else{a.fillStyle=this.lineColor;continue}a.fillRect(b,g,f-b,this.histogramBase-g)}e.style?c!==e.style.color&&(c=a.fillStyle=e.style.color):
|
|
a.fillStyle=this.lineColor;a.fillRect(b,g,f-b,this.histogramBase-g);e.style?c!==e.style.color&&(c=a.fillStyle=e.style.color):c!==this.lineColor&&(c=this.lineColor,a.fillStyle=this.lineColor);0<d&&(e=this.items.item(d-1),g<e.y&&a.fillRect(b,g,1,e.y-g));a.fillRect(f-1,g,1,this.histogramBase-g);a.fillRect(b,g,f-b,1)}}};
|
|
D59.prototype.hitTest=function(a){for(var b=0.5*this.barSpacing+this.lineWidth,c=a.x-b,b=a.x+b,d=this.items.toArray(),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 HitTestResult(HitTestResult.REGULAR)}return null};
|
|
function D67(a){this.items=a.items;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}
|
|
D67.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)};
|
|
D67.prototype._drawSimpleMode=function(a){a.beginPath();this.walkLine(a,this.items.toArray());a.stroke();if(this.withMarkers){i=this.items.size();var b=this.lineWidth+2,c=2*Math.PI,d;for(a.beginPath();i--;)if(d=this.items.item(i))a.moveTo(d.x,d.y),a.arc(d.x,d.y,b,0,c);a.fill()}};
|
|
D67.prototype.walkLine=function(a,b,c,d){if(b){for(var e=0.25*this.barSpacing,f,g,h,k,l=paneRendererCoordinateIsValid,m=0,q=b.length;m<q;m++)if(k=b[m],l(k.y)){g=k;f=m;break}if("undefined"!==typeof f&&g)for(var n=this.withSteps&&this.lineWidth&&0==this.lineWidth%2?0.5:0,m=f,q=b.length;m<q;m++){g=b[m];k=b[m+1]||{};if(l(g.y))if(h&&l(h.y))this.withSteps&&a.lineTo(h.x+n,g.y+n),a.lineTo(g.x+n,g.y+n),c&&!l(k.y)&&a.lineTo(g.x+n,d);else if(k&&l(k.y))c?(m!=f&&a.lineTo(g.x+n,d),a.lineTo(g.x+n,g.y+
|
|
n)):a.moveTo(g.x+n,g.y+n);else if(c){if(0===m)continue;m!=f&&a.lineTo(g.x-e+n,d);a.lineTo(g.x-e+n,g.y+n);a.lineTo(g.x+e+n,g.y+n);a.lineTo(g.x+e+n,d)}else a.moveTo(g.x-e+n,g.y+n),a.lineTo(g.x+e+n,g.y+n);h=g}}};
|
|
D67.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.size()){var c,d,e,f=0.25*this.barSpacing,g=paneRendererCoordinateIsValid;a.beginPath();(c=this.items.item(0))&&a.moveTo(c.x,c.y);for(var h=1;h<this.items.size();++h){c=this.items.item(h-1);d=this.items.item(h);e=this.items.item(h+1);var k,l,m;d.style&&!this.forceLineColor?(k=d.style.color,l=d.style.width,m=d.style.style):
|
|
(k=this.lineColor,l=this.lineWidth,m=this.lineStyle);this.ignorePaletteLineWidth&&(l=this.lineWidth);k.toLowerCase()!=a.strokeStyle.toLowerCase()||l!=a.lineWidth||m!=a.lineStyle?(a.stroke(),a.beginPath(),a.strokeStyle=k,a.lineWidth=l,a.lineStyle=m,m===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()}};
|
|
D67.prototype.hitTest=function(a){for(var b=selectionTolerance(this.lineWidth),c,d,e,f,g=0,h=this.items.size()-1;2<h-g;)c=Math.round((h+g)/2),this.items.item(c).x<=a.x?g=c:h=c;g=Math.max(1,g-1);for(rigth=Math.min(this.items.size()-1,h+1);g<=h;++g)if(c=this.items.item(g-1),d=this.items.item(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 HitTestResult(HitTestResult.REGULAR);
|
|
return null};function D52(a){a.forceLineColor=!0;D67.call(this,a);this.color1=a.color1;this.color2=a.color2;this.bottom=a.bottom;this._simpleMode=a.simpleMode}inherit(D52,D67);
|
|
D52.prototype.draw=function(a){if(0!==this.items.size()){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.size();c<d;c++){var e=this.items.item(c);if(paneRendererCoordinateIsValid(e.y)){b=e;break}}if(b){a.moveTo(b.x,this.bottom);D67.prototype.walkLine.call(this,a,this.items.toArray(),!0,this.bottom);for(var f,c=this.items.size()-1;0<=c;c--)if(e=this.items.item(c),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;D67.prototype.draw.call(this,a)}}};function D56(a){this._data=a;this._barWidth=optimalBarWidth(a.barSpacing);this._barBorderWidth=1}
|
|
D56.prototype.draw=function(a){var b=this._data.bars.clone(),c=this._data.barSpacing,d=this._data.drawWick,e=this._data.drawBorder,f=this._data.wickColor,g=this._barBorderWidth,h=this._barWidth,k=b.size(),l,m,q;a.lineCap="square";a.lineStyle=this._data.lineStyle;if(1>c){if(d){a.strokeStyle=f;a.lineWidth=1;a.beginPath();for(k=b.size();0<k--;)c=b.item(k),a.moveTo(c.time,c.low),a.lineTo(c.time,c.high);a.stroke()}a.lineWidth=1;e="";h=!1;a.beginPath();for(k=b.size();0<k--;)c=b.item(k),
|
|
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{a.translate(0.5,0.5);a.lineWidth=g;b.sort(function(a,b){return a.color>b.color?1:-1});if(d)for(a.fillStyle=f;0<k--;)c=b.item(k),d=c.time,g=c.open,l=c.high,m=c.low,q=c.close,f=Math.min(g,q),g=Math.max(g,q),c.hollow?(a.fillRect(d,l,1,f-l),a.fillRect(d,g,1,m-g)):a.fillRect(d,l,1,m-l);if(e)for(k=b.size();0<k--;)c=b.item(k),b.item(k+1)&&c.borderColor==
|
|
b.item(k+1).borderColor||(a.fillStyle=c.borderColor),c.hollow||(d=c.time,g=c.open,q=c.close,l=Math.round(d-h),d=Math.round(d+h),f=Math.min(g,q),g=Math.max(g,q),a.fillRect(l,f,d-l+1,g-f+1));for(k=b.size();0<k--;)c=b.item(k),d=c.time,g=c.open,l=c.high,m=c.low,q=c.close,l=Math.round(d-h),d=Math.round(d+h),f=Math.min(g,q),g=Math.max(g,q),b.item(k+1)&&c.color==b.item(k+1).color||(a.fillStyle=c.color,a.strokeStyle=c.color),c.hollow?(a.translate(-0.5,-0.5),a.strokeRect(l+1,f+1,d-l,g-f),a.translate(0.5,0.5)):
|
|
(e&&(l+=1,f+=1,d-=1,g-=1),a.fillRect(l,f,d-l+1,g-f+1))}};D56.prototype.hitTest=function(a){var b=this._data.bars,c=0.5*this._data.barSpacing;if(b.isEmpty()||a.x<b.first().time-c||a.x>b.last().time+c)return null;for(var d=null,e=0;e<b.size();++e){var f=b.item(e);if(a.x<=f.time+c){d=f;break}}b=selectionTolerance(this._barBorderWidth);return d&&d.high-b<=a.y&&a.y<=d.low+b?new HitTestResult(HitTestResult.REGULAR):null};
|
|
function D60(a){this.items=a.items;this.barSpacing=a.barSpacing;this.lineColor=a.lineColor;this.lineWidth=a.lineWidth;this.lineStyle=a.lineStyle}D60.prototype.draw=function(a){a.fillStyle=this.lineColor;this._drawLines(a)};D60.prototype.drawCross=function(a,b){a.fillRect(b.x-3*this.lineWidth/2,b.y-this.lineWidth/2,3*this.lineWidth,this.lineWidth);a.fillRect(b.x-this.lineWidth/2,b.y-3*this.lineWidth/2,this.lineWidth,3*this.lineWidth)};
|
|
D60.prototype._drawLines=function(a){for(var b=0;b<this.items.size();++b){var c=this.items.item(b),d=c.y;isNaN(c.x)||isNaN(d)||(a.fillStyle=void 0!=c.style?c.style.color:this.lineColor,this.drawCross(a,c))}};
|
|
D60.prototype.hitTest=function(a){for(var b=selectionTolerance(this.lineWidth),c,d,e,f,g=1;g<this.items.size();++g)if(c=this.items.item(g-1),d=this.items.item(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 HitTestResult(HitTestResult.REGULAR);return null};
|
|
function D57(a){this.items=a.items;this.barSpacing=a.barSpacing;this.lineColor=a.lineColor||a.color;this.radius=a.lineWidth||a.height/2;this.vertOffset=a.vertOffset||0}D57.prototype.draw=function(a){a.fillStyle=this.lineColor;for(var b=0;b<this.items.size();++b){var c=this.items.item(b),d=c.x,e=c.y+this.vertOffset;isNaN(d)||isNaN(e)||(a.fillStyle=void 0!=c.style?c.style.color:this.lineColor,a.beginPath(),a.arc(d,e,this.radius,0,2*Math.PI,!1),a.fill())}};
|
|
D57.prototype.hitTest=function(a){for(var b=this.vertOffset,c=selectionTolerance(2*this.radius),d=0;d<this.items.size();++d){var e=this.items.item(d);if(e&&(offsettedPoint=new MathEx.Point(e.x,e.y+b),offsettedPoint.substract(a).length()+this.radius<=c))return new HitTestResult(HitTestResult.REGULAR)}return null};PaneRendererArrowsUpDownItem=function(a,b,c,d){this.x=a;this.y=b;this.height=c;this.isUp=d};inherit(PaneRendererArrowsUpDownItem,MathEx.Point);
|
|
function D53(a){this.items=a.items;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)}D53.prototype._calculateVerticalOffset=function(a){return Math.round((a||0)/4)};D53.prototype._calculateMinHeight=function(a){return this.width||this._calculateWidth(a)};
|
|
D53.prototype._calculateWidth=function(a){a=a||this.barSpacing;return Math.round(a/2)};
|
|
D53.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.size();g<h;g++){var k=this.items.item(g),l=k.isUp?-1:1,m=Math.abs(k.height),q=k.y-l*this.vertOffset;a.beginPath();a.translate(k.x,q);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,-q)}a.translate(-1,-1)};
|
|
D53.prototype.hitTest=function(a){for(var b=Math.round(this.width/2),c=Math.round(this.width),d=0;d<this.items.size();++d){var e=this.items.item(d);if(e&&void 0!==e.x&&null!==e.x&&!isNaN(e.x)&&void 0!==e.y&&null!==e.y&&!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 HitTestResult(HitTestResult.REGULAR)}}};
|
|
function D72(a){this.items=a.items;this.ch=a["char"][0];this.color=a.color;this.vertOffset=a.vertOffset;this.height=Math.round(a.height)}
|
|
D72.prototype.draw=function(a){a.font=this.height+"px Arial";var b=a.measureText(this.ch),c=this.height/2,b=b.width/2;a.translate(1,1);for(var d=0,e=this.items.size();d<e;d++){var f=this.items.item(d);newFillStyle=void 0!=f.style?f.style.color:this.color;a.fillStyle=newFillStyle;a.fillText(this.ch,f.x-b,f.y+this.vertOffset+c)}a.translate(-1,-1)};
|
|
D72.prototype.hitTest=function(a){for(var b=this.vertOffset,c=selectionTolerance(this.height),d=0;d<this.items.size();++d){var e=this.items.item(d);if(e&&(offsettedPoint=new MathEx.Point(e.x,e.y+b),offsettedPoint.substract(a).length()<=c))return new HitTestResult(HitTestResult.REGULAR)}return null};function D51(a){this.items=a.items;this.height=a.height||a.width;this.width=a.width||a.height;this.color=a.color;this.vertOffset=a.vertOffset||0}
|
|
D51.prototype.draw=function(a){for(var b=0,c=this.items.size();b<c;b++){var d=this.items.item(b);color=void 0!=d.style?d.style.color:this.color;this._drawShape(a,d,this.vertOffset,this.width,this.height,color)}};D51.prototype._drawShape=function(a,b,c,d,e,f){throw Error("Method should be redefined in the child");};
|
|
D51.prototype.hitTest=function(a,b){var c=Math.max(this.height,this.width),d=this.vertOffset;b=b||HitTestResult.REGULAR;for(var e,f=0;f<this.items.size();++f)if(e=this.items.item(f))if(e=new MathEx.Point(e.x,e.y+d),e=e.substract(a).length(),e<=c)return new HitTestResult(b);return null};function D73(a){D51.call(this,a)}inherit(D73,D51);
|
|
D73.prototype._drawShape=function(a,b,c,d,e,f){a.lineWidth=2;a.strokeStyle=f;f=b.x-d/2;b=b.y-e/2+c;a.translate(f,b);a.beginPath();a.moveTo(0,0);a.lineTo(d,e);a.moveTo(0,e);a.lineTo(d,0);a.stroke();a.translate(-f,-b)};function D71(a){D51.call(this,a)}inherit(D71,D51);
|
|
D71.prototype._drawShape=function(a,b,c,d,e,f){var g=Math.round(e/3),h=b.x;b=b.y-2*g+c;a.fillStyle=f;a.translate(h,b);a.beginPath();a.moveTo(0,0);a.lineTo(d/2,e);a.lineTo(-d/2,e);a.lineTo(0,0);a.fill();a.translate(-h,-b)};function D70(a){D51.call(this,a)}inherit(D70,D51);
|
|
D70.prototype._drawShape=function(a,b,c,d,e,f){a.fillStyle=f;var g=Math.round(e/3);f=b.x-d/2;b=b.y-g+c;a.translate(f,b);a.beginPath();a.moveTo(0,0);a.lineTo(d,0);a.lineTo(d/2,e);a.lineTo(0,0);a.fill();a.translate(-f,-b)};function PaneRendererTriangleApexLeft(a){D51.call(this,a)}inherit(PaneRendererTriangleApexLeft,D51);
|
|
PaneRendererTriangleApexLeft.prototype._drawShape=function(a,b,c,d,e,f){a.fillStyle=f;f=b.x+d/2;b=b.y-e/2+c;a.translate(f,b);a.beginPath();a.moveTo(0,0);a.lineTo(0,e);a.lineTo(-d,e/2);a.lineTo(0,0);a.fill();a.translate(-f,-b)};function D63(a){D51.call(this,a)}inherit(D63,D51);
|
|
D63.prototype._drawShape=function(a,b,c,d,e,f){a.fillStyle=f;f=b.x-d/2;b=b.y-e/2+c;c=(d-3)/3;a.translate(f,b);a.beginPath();a.moveTo(0,0);a.lineTo(3,0);a.bezierCurveTo(c,-c,2*c,c,d,0);a.lineTo(d,e/2);a.bezierCurveTo(d-c,e/2+c,d-2*c,e/2-c,3,e/2);a.lineTo(3,e);a.lineTo(0,e);a.closePath();a.fill();a.translate(-f,-b)};function D62(a){D51.call(this,a)}inherit(D62,D51);
|
|
D62.prototype._drawShape=function(a,b,c,d,e,f){a.strokeStyle=f;a.lineWidth=2;f=b.x-d/2;b=b.y-e/2+c;a.translate(f,b);a.beginPath();a.moveTo(d/2,0);a.lineTo(d/2,e);a.moveTo(0,e/2);a.lineTo(d,e/2);a.stroke();a.translate(-f,-b)};function D58(a){D51.call(this,a)}inherit(D58,D51);
|
|
D58.prototype._drawShape=function(a,b,c,d,e,f){a.fillStyle=f;d=Math.max(d,e)/2;a.beginPath();a.arc(b.x,b.y+c,d,0,2*Math.PI,!1);a.fill()};function D54(a){this._items=a.items;this._y=a.y;this._h=a.h;this._w=a.w}D54.prototype.draw=function(a){};
|
|
D54.prototype.drawBackground=function(a){a.save();"undefined"==typeof FlashCanvas&&a.translate(-0.5,-0.5);for(var b=0;b<this._items.size();++b){var c=this._items.item(b);if(void 0!=c.color){a.fillStyle=c.color;var d=b==this._items.size()-1?this._w:this._items.item(b+1).x-c.x;a.fillRect(c.x,this._y,d,this._h)}}a.restore()};D54.prototype.hitTest=function(a){return null};function PriceRange(a,b){this.m_minValue=a;this.m_maxValue=b}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.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.logDebug("PriceRange.scaleAroundCenter: invalid coeff");else if(0!==this.m_maxValue-this.m_minValue){var b=0.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.logDebug("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)};function TickMark(a,b,c){this.coord=a;this.label=b;this.major=c}
|
|
function PriceTickSpanCalculator(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");}}
|
|
PriceTickSpanCalculator.prototype.TICK_SPAN_EPSILON=1E-9;
|
|
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};function PriceTickMarkBuilder(a,b,c){this.m_marks=[];this.m_base=b;this.m_priceScale=a;this.m_fontHeight=14;this._formatter=c}PriceTickMarkBuilder.prototype.TICK_DENSITY=2;PriceTickMarkBuilder.prototype.base=function(){return this.m_base};PriceTickMarkBuilder.prototype.setBase=function(a){if(0>a)throw new RangeError("base < 0");this.m_base=a};
|
|
PriceTickMarkBuilder.prototype.fontHeight=function(){return this.m_fontHeight};PriceTickMarkBuilder.prototype.setFontHeight=function(a){this.m_fontHeight!==a&&(this.m_fontHeight=a)};
|
|
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 PriceTickSpanCalculator(this.m_base,[2,2.5,2]),e=new PriceTickSpanCalculator(this.m_base,[2,2,2.5]),f=new 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)};
|
|
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}
|
|
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._formatter,b=this.m_priceScale.height(),c=this.m_priceScale.coordinateToPrice(b-1),d=this.m_priceScale.coordinateToPrice(0),b=d>=c?1:-1,e=Math.max(d,c),c=Math.min(d,c),d=e;if(d!=c){var e=this.tickSpan(d,c),f=d%e,f=f+(0>f?e:0);this.m_marks=[];a||(a=new PriceFormatter(calculateBaseForTickSpan(e)));for(var g=null,d=
|
|
d-f;d>c;d-=e)f=this.m_priceScale.priceToCoordinate(d),null!==g&&Math.abs(f-g)<this.tickMarkHeight()||(g=new TickMark(f,a.format(d),0),this.m_marks.push(g),g=f,this.m_priceScale.isLog()&&(e=this.tickSpan(d*b,c)))}}};PriceTickMarkBuilder.prototype.marks=function(){return this.m_marks};
|
|
function D75(a){function b(){for(var a=c.m_dataSources,b=0;b<a.size();b++){var f=a.item(b);f.priceScaleChanged&&f.priceScaleChanged.fire(c)}}this.Z1=a;this.m_height=0;this.m_priceRange=null;this.m_dataSources=new List;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 PriceTickMarkBuilder(this,100,new PriceFormatter(100));this.Z1.percentage.listeners().subscribe(this,
|
|
D75.prototype.updateFormatter);this.Z1.showSymbolLabels.listeners().subscribe(this,D75.prototype.updateShowSymbolLabels);var c=this;this.Z1.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.Z1.percentage.listeners().subscribe(null,function(){c.Z1.autoScale.setValue(!0)});
|
|
this.Z1.percentage.listeners().subscribe(null,function(){c.Z1.autoScaleDisabled.setValue(c.Z1.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(),SEARCH_NEAREST_RIGHT).value[CLOSE_PLOT];null!=
|
|
a&&void 0!==b&&(c.Z1.percentage.value()?c.setPriceRange(a.convertToPercents(b)):c.setPriceRange(a.convertFromPercents(b)))}});this._sourcesToUpdateViews=this._sourcesForAutoscale=null;this._hasSeries=!1;this.Z1.percentage.listeners().subscribe(null,b);this.Z1.log.listeners().subscribe(null,b)}D75.prototype.isLog=function(){return this.Z1.log.value()};D75.prototype.isPercent=function(){return this.Z1.percentage.value()};
|
|
D75.prototype.properties=function(){return this.Z1};D75.prototype.height=function(){return this.m_height};D75.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()};D75.prototype.topMargin=function(){return Math.max(this.m_topMargin,this._studyTopMargin)};
|
|
D75.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};D75.prototype.bottomMargin=function(){return Math.max(this.m_bottomMargin,this._studyBottomMargin)};
|
|
D75.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};D75.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var a=this.height()*(1-this.topMargin()-this.bottomMargin());return this._internalHeightCache=a};D75.prototype.priceRange=function(){return this.m_priceRange};
|
|
D75.prototype.setPriceRange=function(a){if(!a instanceof PriceRange)throw new TypeError("incorrect price range");this.m_priceRange=a;this._marksCache=null};D75.prototype.isEmpty=function(){return 0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()};D75.prototype.invertedCoordinate=function(a){return this.height()-1-a};D75._logicalOffset=4;D75._coordOffset=1E-4;D75.prototype.log10=function(a){return Math.log(a)/Math.log(10)};
|
|
D75.prototype._toLog=function(a){var b=Math.abs(a);if(1E-6>b)return 0;b=this.log10(b+D75._coordOffset)+D75._logicalOffset;return 0>a?-b:b};D75.prototype.priceToLogical=function(a){return this.isLog()&&a?this._toLog(a):a};D75.prototype._fromLog=function(a){var b=Math.abs(a);if(1E-6>b)return 0;b=Math.pow(10,b-D75._logicalOffset)-D75._coordOffset;return 0>a?-b:b};D75.prototype.logicalToPrice=function(a){return this.isLog()?this._fromLog(a):a};
|
|
D75.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)};D75.prototype.pricesToCoordinates=function(a){this.pricesToCoordinatesEx(a.toArray(),function(a){return a.y},function(a,c){a.y=c})};
|
|
D75.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]),isNaN(h)||void 0===h||null===h||c(a[g],Math.round(this.m_height-1-(d+f*(h-e))))};
|
|
D75.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];f&&(a[e]=Math.round(this.m_height-1-(b+d*(f-c))))}};
|
|
D75.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))}}};
|
|
D75.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)};D75.prototype.isAutoScale=function(){return this.Z1.autoScale.value()&&!(this.mainSource()instanceof TradingView.Series&&this.mainSource().isLockScale())};D75.prototype.isPercentage=function(){return this.Z1.percentage.value()};
|
|
D75.prototype.Z18=function(){return this.m_dataSources};D75.prototype.orderedSources=function(){if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(var a=[],b=0;b<this.Z18().size();b++){var c=this.Z18().item(b);null==c.zorder()&&c.setZorder(b+1);a.push(c)}a=D74.sortSources(a);return this._cachedOrderedSoruces=new List(a)};D75.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null};
|
|
D75.prototype.addDataSource=function(a){if(!this.m_dataSources.contains(a)){isInherited(a.constructor,TradingView.Series)&&(this._hasSeries=!0);var b=this;a.properties().visible.listeners().subscribe(null,function(){b._sourcesForAutoscale=null});this.m_dataSources.append(a);this._mainSource=void 0;this._sourcesToUpdateViews=this._sourcesForAutoscale=null;this.updateFormatter();this.initScaleProperties();this.invalidateSourcesCache()}};
|
|
D75.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)};
|
|
D75.prototype.removeDataSource=function(a){if(!this.m_dataSources.contains(a))throw Error("source is not attached to scale");this.m_dataSources.remove(a);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()};D75.prototype.setAutoScale=function(a){this.Z1.autoScale.setValue(a)};
|
|
D75.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())};D75.prototype.marks=function(){if(this._marksCache)return this._marksCache;this.m_markBuilder.rebuildTickMarks();return this._marksCache=this.m_markBuilder.marks()};
|
|
D75.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+0.2*(this.m_height-1))/(a+0.2*(this.m_height-1));a=Math.max(a,0.1);this.m_priceRange=this.m_priceRangeSnapshot.clone();this.m_priceRange.scaleAroundCenter(a);this.recalcLockedScale(b)}};
|
|
D75.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[CLOSE_PLOT],c=PriceRange.prototype.convertToPercent.call(null,d+c,d)-PriceRange.prototype.convertToPercent.call(null,
|
|
d,d);c*=this.internalHeight()/this.priceRange().length();0.5>c||50<c?this.m_priceRange=a:(b.setBarSpacing(c),b._correctOffset());this.mainSource().model().mainSeries().requestMoreData()}}};D75.prototype.endScale=function(){this.isPercentage()||null===this.m_scaleStartPoint||(this.m_priceRangeSnapshot=this.m_scaleStartPoint=null)};
|
|
D75.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())};D75.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)}};
|
|
D75.prototype.endScroll=function(){this.isAutoScale()||null===this.m_scrollStartPoint||(this.m_priceRangeSnapshot=this.m_scrollStartPoint=null)};
|
|
D75.prototype.state=function(){var a={};a.m_priceRange=this.priceRange()?this.priceRange().clone():null;a.m_isAutoScale=this.isAutoScale();a.m_isPercentage=this.Z1.percentage.value();a.m_isLog=this.Z1.log.value();a.m_height=this.m_height;a.m_topMargin=this.m_topMargin;a.m_bottomMargin=this.m_bottomMargin;a.m_showSymbolLabels=this.Z1.showSymbolLabels.value();return a};
|
|
D75.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.Z1.percentage.setValue(a.m_isPercentage);void 0!==a.m_isLog&&this.Z1.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);void 0!==a.m_showSymbolLabels&&this.Z1.showSymbolLabels.setValue(a.m_showSymbolLabels);this._mainSource=void 0;this._scaleSeriesOnly=!1};
|
|
D75.prototype.mainSource=function(){if(void 0!==this._mainSource)return this._mainSource;for(var a=0;a<this.m_dataSources.size();a++)if(isInherited(this.m_dataSources.item(a).constructor,PriceDataSource))return this._mainSource=a=this.m_dataSources.item(a);this._mainSource=void 0;return null};D75.prototype.formatter=function(){this._formatter||this.updateFormatter();return this._formatter};
|
|
D75.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 PercentageFormatter:a&&(this._formatter=a.formatter());this.m_markBuilder=new PriceTickMarkBuilder(this,b,this._formatter);this.m_markBuilder.rebuildTickMarks()};
|
|
D75.prototype._recalculateSourcesForAutoscale=function(){this._sourcesForAutoscale=new List;this._mainSource&&(this._scaleSeriesOnly=this._mainSource.model().properties().scalesProperties.scaleSeriesOnly.value());for(var a=this._scaleSeriesOnly&&this._hasSeries,b=0;b<this.Z18().size();b++){var c=this.Z18().item(b),d;d=c;d=d.properties().visible.value()||d instanceof TradingView.Series?a?isInherited(d.constructor,TradingView.Series):isInherited(d.constructor,PriceDataSource):
|
|
!1;d&&this._sourcesForAutoscale.append(c)}};D75.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};
|
|
D75.prototype.recalculatePriceRange=function(a){this._studyBottomMargin=this._studyTopMargin=0;var b=null,c=this.sourcesForAutoscale();this.mainSource();for(var d=0;d<c.size();d++){var e=c.item(d);if(e.properties().visible.value()){var f=a.firstBar(),g=a.lastBar(),f=e.priceRange(f,g);null===b&&f?b=f:f&&(b=b.merge(f));e.margins&&(e=e.margins(),this._studyTopMargin=Math.max(e[0],this._studyTopMargin),this._studyBottomMargin=Math.max(e[1],this._studyBottomMargin))}}b?(b.minValue()==b.maxValue()&&
|
|
(b=new PriceRange(b.minValue()-0.5,b.maxValue()+0.5)),this.setPriceRange(b)):this.m_priceRange||this.setPriceRange(new PriceRange(-0.5,0.5))};D75.prototype.sourcesToUpdateViews=function(){if(!this._sourcesToUpdateViews){this._sourcesToUpdateViews=new List;for(var a=0;a<this.Z18().size();a++){var b=this.Z18().item(a);isInherited(b.constructor,D46)&&!b.isActualSymbol()||this._sourcesToUpdateViews.append(b)}}return this._sourcesToUpdateViews};
|
|
D75.prototype.updatePaneViews=function(){for(var a=this.sourcesToUpdateViews(),b=0;b<a.size();b++)a.item(b).updateAllViews()};D75.prototype.updateShowSymbolLabels=function(){for(var a=this.sourcesToUpdateViews(),b=0;b<a.size();b++)a.item(b).updateAllViews();this.mainSource()&&this.mainSource().model().Z19(new Q22(Q22.LIGHT_UPDATE))};Q58=function(a,b){this.m_bars=new PlotList(["time","open","high","low","close"]);this.m_nsBars=new PlotList(["time","open","high","low","close"]);this.m_series=a;this.m_model=b;this.boxSize=this.lastProjectionPrice=void 0};Q58.prototype.bars=function(){return this.m_bars};Q58.prototype.nsBars=function(){return this.m_nsBars};Q58.prototype.size=function(){return this.m_nsBars._end-this.m_nsBars._start+(this.m_bars._end-this.m_bars._start)};
|
|
Q58.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);};Q58.prototype.clear=function(){this.m_bars=new PlotList(["time","open","high","low","close"]);this.m_nsBars=new PlotList(["time","open","high","low","close"]);this.boxSize=this.lastProjectionPrice=void 0};
|
|
Q58.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars._items[0]:this.m_bars._items[0]};Q58.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()};Q58.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]};
|
|
Q58.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)};Q58.prototype.valueAt=function(a){if(a=this.search(a))return a.value};
|
|
Q58.prototype.firstBar=function(){if(this.m_model.timeScale().isEmpty())return null;var a=this.m_model.timeScale().visibleBars(),b=a.firstBar(),a=a.lastBar(),c=null,d=function(a,b){if(!c)return c=b,!0};this.bars().range(b,a).isEmpty()?this.nsBars().range(b,a).each(d):this.bars().range(b,a).each(d);return c};Q58.prototype.firstValue=function(){var a=this.firstBar();return a?a[CLOSE_PLOT]:null};
|
|
Q58.prototype.timeToBarIndex=function(a,b){if(null===a)return TradingView.logDebug("SeriesData.timeToBarIndex: time should be a number of seconds since 1970. But it is null"),0;if(b===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[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[TIME_PLOT])return c;return this.m_bars.firstIndex()}if(b===
|
|
SEARCH_FROM_LEFT){for(c=this.m_bars.firstIndex();c<=this.m_bars.lastIndex();c++)if(d=this.m_bars._valueAt(c),a<=d[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[TIME_PLOT])return c;return this.m_bars.lastIndex()}TradingView.logDebug("SeriesData.timeToBarIndex: Incorrect options value");return 0};var DEFAULT_BAR_COUNT=300,TIME_PLOT=0,OPEN_PLOT=1,HIGH_PLOT=2,LOW_PLOT=3,CLOSE_PLOT=4,ADT_PLOT=6,SEARCH_FROM_LEFT=-1,SEARCH_FROM_RIGHT=1;function D22(a){this._series=a;this.D99=a.m_model;this._points=(new List).append(new MathEx.Point(0,0))}
|
|
D22.prototype.update=function(){this._visible=!1;if(this._series.properties().showPriceLine.value()){var a=this._series.lastValueData(CLOSE_PLOT,!0);a&&(this._visible=!0,this._points=(new List).append(new MathEx.Point(0,a.coordinate)),this._color=a.color)}};
|
|
D22.prototype.renderer=function(){var a={};a.points=this._points;a.color=this._color;a.linewidth=this._series.properties().priceLineWidth.value();a.linestyle=CanvasEx.LINESTYLE_DOTTED;a.hitTestResult=HitTestResult.REGULAR;a.visible=this._visible;return new HorzLineRenderer(a)};TradingView.defaultRequestOption=function(){return{count:DEFAULT_BAR_COUNT}};
|
|
TradingView.Series=function(a,b,c){PriceDataSource.call(this);this._requestOptions=c?c:TradingView.defaultRequestOption();this.m_model=a;this._chartApi=a._chartApi;this.m_data=new Q58(this,a);this.setProperties(b);this._prevChartStyle=b.style.value();this.W62();this._dataWindowView=new SeriesDataWindowView(this,a);this._statusView=new SeriesStatusView(this,a.properties());this._priceAxisViews=new List;this._priceAxisViews.append(new SeriesPriceAxisView(this,a));this._priceAxisViews.append(new 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.Z1.addExclusion&&this.Z1.addExclusion("visible");this._base=100;this._formatter=new PriceFormatter(this._base);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._predictBars=0;this._futureBarsPaneView=null;this.Z1.showInDataWindow.listeners().subscribe(a,D78.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.Z19(new Q22(Q22.FULL_UPDATE))});this._priceLineView=new D22(this);this.bindJapChartsInputs();this.createExtendedHoursProperty();this.extendedHours.listeners().subscribe(this,function(){this._extendedHoursChanged.fire()});this._extendedHoursNotPermitted.subscribe(this,function(){this.Z1.extendedHours.setValue(!1);
|
|
this.disableSessionBackground()});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,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.item(0).update();b.m_model.Z19(new Q22(Q22.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(),SEARCH_NEAREST_LEFT);if(void 0===b)return null;e=this.data().bars().valueAt(b.index);b=b.index}e=e[CLOSE_PLOT];c&&(a.price=e);this.priceScale().properties().percentage.value()&&
|
|
(c=this.nearestIndex(d.firstBar(),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.coordinate=this.priceScale().priceToCoordinate(e);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||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(){if(!this._futureBarsPaneView){var a=parseInt(this.data().last(),10)+1;this._futureBarsPaneView=new TradingView.W78(this,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.status=function(){return this._status};
|
|
TradingView.Series.prototype.isDWM=function(){return!(3600>+this.Z1.interval.value())};
|
|
TradingView.Series.prototype.W62=function(){this._projectionBarsPaneView=this._paneView=null;this._symbolLabelView=new TradingView.D37(this.m_model,this,CLOSE_PLOT,"firstShortName");var a=this.Z1.style.value();switch(a){case TradingView.Series.STYLE_BARS:this._paneView=new D14(this,this.m_model);break;case TradingView.Series.STYLE_CANDLES:this._paneView=new D15(this,this.m_model);break;case TradingView.Series.STYLE_LINE:this._paneView=
|
|
new D19(this,this.Z1.lineStyle.priceSource.value(),this.m_model);break;case TradingView.Series.STYLE_AREA:this._paneView=new D12(this,this.Z1.areaStyle.priceSource.value(),this.m_model);break;case TradingView.Series.STYLE_RENKO:this._paneView=new D27(this,this.m_model);this._projectionBarsPaneView=new D26(this,this.m_model);break;case TradingView.Series.STYLE_PB:this._paneView=new D21(this,
|
|
this.m_model);this._projectionBarsPaneView=new D25(this,this.m_model);break;case TradingView.Series.STYLE_KAGI:this._paneView=new D18(this,this.m_model);this._projectionBarsPaneView=new D23(this,this.m_model);break;case TradingView.Series.STYLE_PNF:this._paneView=new D20(this,this.m_model);this._projectionBarsPaneView=new D24(this,this.m_model);break;case TradingView.Series.STYLE_HEIKEN_ASHI:this._paneView=
|
|
new D16(this,this.m_model);break;case TradingView.Series.STYLE_HOLLOW_CANDLES:this._paneView=new D17(this,this.m_model);break;default:throw"Unknown chart style assigned: "+a;}};TradingView.Series.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache};
|
|
TradingView.Series.prototype.barColorer=function(){if(this._barColorerCache)return this._barColorerCache;for(var a=null,b=this.m_model.Z18().size()-1;0<=b;b--){var c=this.m_model.Z18().item(b);c.metaInfo&&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 SeriesBarColorer(this):a.pushBackBarColorer(new SeriesBarColorer(this));return this._barColorerCache=a};
|
|
TradingView.Series.prototype.properties=function(){return this.Z1};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()};a&&(b.bars=this.m_data.m_bars.state(),b.nsBars=this.m_data.m_nsBars.state(),b.symbolInfo=this._symbolInfo,b.rtPrice=this.data().lastProjectionPrice);b.boxSize=this.data().boxSize;return b};
|
|
TradingView.Series.prototype.uniqueId=function(){return this.symbol()+"|"+this.interval()};TradingView.Series.prototype.stateForAlert=function(){var a=this.state();a.uniqueId=this.uniqueId();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.Z1=a;this.Z1.symbol.listeners().subscribe(this,TradingView.Series.prototype.changeSymbol);this.Z1.interval.listeners().subscribe(this,TradingView.Series.prototype.changeInterval);this.Z1.timeframe.listeners().subscribe(this,TradingView.Series.prototype.changeTimeFrame);this.Z1.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");timeframe=this.Z1.interval.value()};
|
|
TradingView.Series.prototype.title=function(){return this.properties().symbol.value()+", "+translatedIntervalString(this.properties().interval.value())};TradingView.Series.prototype.changeProperties=function(a){a!==this.Z1.symbol&&a!==this.Z1.interval&&a!==this.Z1.timeframe&&(this._tagsChanged.fire(),this.W62(),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.onData=function(a){switch(a.method){case "symbol_resolved":if(a.params[0]!==this._symbolId){TradingView.logNormal("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 b=this.symbolInfo().minmov/this.symbolInfo().pricescale,c=this.properties();c.style.value()==TradingView.Series.STYLE_RENKO&&c.renkoStyle.inputs.boxSize.value()<
|
|
b?c.renkoStyle.inputs.merge({boxSize:b}):c.style.value()==TradingView.Series.STYLE_PNF&&c.pnfStyle.inputs.boxSize.value()<b?c.pnfStyle.inputs.merge({boxSize:b}):c.style.value()==TradingView.Series.STYLE_KAGI&&c.kagiStyle.inputs.reversalAmount.value()<b&&c.kagiStyle.inputs.merge({reversalAmount:b});break;case "symbol_error":if(a.params[0]!==this._symbolId){TradingView.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+a.params[0]);break}this._setStatus(TradingView.Series.STATUS_INVALID_SYMBOL);
|
|
this.Z1.shortName.setValue(this.Z1.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();
|
|
this.m_model.realignLineTools();break;case "series_timeframe":if(a.params[1]!==this._turnaround)break;this.m_model.setTimeViewport(a.params[2],a.params[3]+10);break;case "series_error":b=a.params[2];D76.enabled("charting_library_debug_mode")&&console.log("Error reason: "+b);b&&b.startsWith("study_not_auth:")?(b=b.split(":",2)[1].split("@",2)[0],b in{BarSetRenko:!0,BarSetPriceBreak:!0,BarSetKagi:!0,BarSetPnF:!0}?this.chartTypeNotPermitted.fire(b):"BarSetSpread"===b&&this.intradaySpreadNotPermitted.fire()):
|
|
"resolution_not_entitled"==b?this.intradayExchangeNotPermitted.fire():"custom_resolution"==b&&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.logNormal("command for old series. Expected:"+this._seriesId+", actual"+a.params.customId);break}this._setStatus(TradingView.Series.STATUS_LOADING);break;case "series_completed":if(a.params[2]!==this._turnaround)break;
|
|
if(a.params[0]!==this._seriesId){TradingView.logNormal("command for old series. Expected:"+this._seriesId+", actual"+a.params.customId);break}b=a.params[1];"pulsed"==b&&(b="delayed");switch(b){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)}b.match(/delayed_streaming/)&&this._setStatus(TradingView.Series.STATUS_DELAYED_STREAMING);
|
|
this.requestMoreData();b=this.m_model.paneForSource(this);b.recalculatePriceScale(this.priceScale());this.m_model.Z19(new Q22(Q22.FULL_UPDATE));this.m_data.size()&&this._tickmarksRangeChanged.fire({start:this.data().first().value[TIME_PLOT],end:this.data().last().value[TIME_PLOT]});this.model().recalcVisibleRangeStudy(this.model().Z18(),!0);!this.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),
|
|
this.model().timeScale().correctBarSpacing(),b=this.model().timeScale().visibleBars(),this.priceScale().setPriceRange(this.priceRange(b.firstBar(),b.lastBar())));this._seriesLoaded=!0;this._onCompleted.fire();break;case "data_update":if(a.params.customId!==this._seriesId){TradingView.logNormal("command for old series. Expected:"+this._seriesId+", actual"+a.params.customId);break}if(this.status()===TradingView.Series.STATUS_INVALID_SYMBOL)break;0<a.params.plots.length&&(this._endOfData=!1);a.params.plots.length?
|
|
(b=this.m_data.m_bars.size(),this.m_data.m_bars.merge(a.params.plots),b!=this.bars().size()&&this._barReceived.fire(this.m_data.m_bars.size()),this.model().recalcVisibleRangeStudy(this.model().Z18(),!0)):(this.m_data.clear(),this._startLoading.fire());b=this.properties().style.value();!a.params.nonseries||b!==TradingView.Series.STYLE_RENKO&&b!==TradingView.Series.STYLE_KAGI&&b!==TradingView.Series.STYLE_PNF&&b!==TradingView.Series.STYLE_PB?a.params.nonseries||(this.m_data.m_nsBars.clear(),
|
|
this.m_data.lastProjectionPrice=void 0):(b=this.parseJapProjBars(a.params.nonseries),this.m_data.m_nsBars=b.nsBars,this.m_data.lastProjectionPrice=b.lastPrice,this.m_data.boxSize=b.boxSize);b=this.m_model.paneForSource(this);this.m_model.updateAllVolumeStudies();this.m_model.recalculatePane(b);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 PlotList(["time","open","high","low","close"]),c=this.model().timeScale(),d=this.properties().style.value();if(a.d&&""!==a.d)for(var e=JSON.parse(a.d).data,f=e.price,g=e.boxSize,e=e.bars,h=0;e&&h<e.length;h++){var k=[],l=a.indexes[e[h].time];k.push(c.points().valueAt(l));k.push(e[h].open);k.push(e[h].high);k.push(e[h].low);k.push(e[h].close);k.push(e[h].volume);d===TradingView.Series.STYLE_KAGI?k.push(e[h].additionalPrice):d===TradingView.Series.STYLE_PNF&&
|
|
k.push(e[h].factor);b.add(l,k)}return{nsBars:b,lastPrice:f,boxSize:g}};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 Q58(this,this.model());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.Z1.interval.value(),this._handler)):(this._seriesId=
|
|
this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,this.Z1.interval.value(),this._prepareChartApiParams(),this._handler));this.Z1.showInDataWindow.listeners().subscribe(this.m_model,D78.prototype.fullUpdate);this.m_symbol=this.Z1.symbol.value();this.m_interval=this.Z1.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,D76.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.setSymbolIntervalDelayed=function(){this._setSymbolIntervalDelay&&clearTimeout(this._setSymbolIntervalDelay);this._setSymbolIntervalDelay=setTimeout(function(){delete this._setSymbolIntervalDelay;this.setSymbolInterval(this.Z1.symbol.value(),this.Z1.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)||D76.enabled("same_data_requery"),f=this.m_interval!==e||D76.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._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);g._modifyTimer=null},5)}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.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)[OPEN_PLOT]};TradingView.Series.prototype.high=function(a){return this.m_data.valueAt(a)[HIGH_PLOT]};TradingView.Series.prototype.low=function(a){return this.m_data.valueAt(a)[LOW_PLOT]};
|
|
TradingView.Series.prototype.close=function(a){return this.m_data.valueAt(a)[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(!isInteger(a))return TradingView.logDebug("Series.priceRange: incorrect startBar"),null;if(!isInteger(b))return TradingView.logDebug("Series.priceRange: incorrect endBar"),null;if(this.data().isEmpty())return null;if(this.isLockScale()){var c=this.data().boxSize;void 0===c&&this.fixBoxSize();var c=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/this.data().boxSize),d=this.data().search(b,SEARCH_NEAREST_LEFT),d=(d.value[HIGH_PLOT]+
|
|
d.value[LOW_PLOT])/2,e=new PriceRange(d-0.5*c,d+0.5*c),f=this.data().search(a,SEARCH_NEAREST_RIGHT);return this.priceScale().properties().percentage.value()&&e?e.convertToPercents(f.value[CLOSE_PLOT]):e}this.properties().style.value===TradingView.Series.STYLE_PNF&&(c=this.data().boxSize,e.apply(e.minValue()-0.5*c,e.maxValue()+0.5*c));f=e=null;c=function(a,b){f||(f=b);null===e?e=new PriceRange(b[LOW_PLOT],b[HIGH_PLOT]):e.apply(b[LOW_PLOT],b[HIGH_PLOT])};this.data().bars().range(a,b).each(c);this.data().nsBars().range(a,
|
|
b).each(c);e&&e.minValue()===e.maxValue()&&(e=new PriceRange(e.minValue()-0.5,e.maxValue()+0.5));return this.priceScale().properties().percentage.value()&&e?e.convertToPercents(f[CLOSE_PLOT]):this.priceScale().isLog()&&e?new PriceRange(this.priceScale().priceToLogical(e.minValue()),this.priceScale().priceToLogical(e.maxValue())):e};TradingView.Series.prototype.nearestData=function(a,b){if(isInteger(a)){var c=this.data().search(a,b);return c?c:void 0}TradingView.logDebug("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=(new List).append(this._paneView);this._futureBarsPaneView&&a.append(this._futureBarsPaneView);this._projectionBarsPaneView&&a.append(this._projectionBarsPaneView);a.append(this._priceLineView);a.append(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.properties().showLastValue.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 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 PriceFormatter(b,c,"true"===a[2])}this.priceScale()&&this.priceScale().updateFormatter()};
|
|
TradingView.Series.prototype.updateSymbolInfo=function(a){var b=this,c=a&&(a.pro_name||a.full_name);if(this._symbolInfo=a)this.Z1.shortName.setValue(a.name),c&&this.Z1.symbol.value().toUpperCase()!==c.toUpperCase()&&this.Z1.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.item(0).update();this._priceAxisViews.item(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.Z1.symbol.value(),this.Z1.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),this._setStatus(TradingView.Series.STATUS_LOADING)))}}};
|
|
TradingView.Series.prototype.bindJapChartsInputs=function(){this.Z1.style.listeners().subscribe(this,this.onChartStyleChanged);this.Z1.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged);this.Z1.renkoStyle.inputs.source.listeners().subscribe(this,this.onInputChanged);this.Z1.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged);this.Z1.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged);this.Z1.pbStyle.inputs.lb.listeners().subscribe(this,
|
|
this.onInputChanged);this.Z1.pbStyle.inputs.source.listeners().subscribe(this,this.onInputChanged);this.Z1.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged);this.Z1.kagiStyle.inputs.source.listeners().subscribe(this,this.onInputChanged);this.Z1.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged);this.Z1.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged);this.Z1.pnfStyle.inputs.sources.listeners().subscribe(this,
|
|
this.onInputChanged);this.Z1.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged);this.Z1.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged);var a=this;this.Z1.lockScale.listeners().subscribe(this,function(b){b.value()&&a.model().timeScale().recalcLockedScale()})};
|
|
TradingView.Series.prototype.createExtendedHoursProperty=function(){function a(){var a=b.Z1.extendedHours.value();a&&(1440>=+b.Z1.interval.value()||(a=!1));b.extendedHours.setValue(a)}var b=this;b.extendedHours=new Property;b.Z1.extendedHours.listeners().subscribe(null,a);b.Z1.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())};TradingView.Series.prototype.onInputChanged=function(){this.restart()};TradingView.Series.prototype.onExtendedHoursChanged=function(){return this._extendedHoursChanged};
|
|
TradingView.Series.prototype.getSymbolString=function(){var a;a=D76.enabled("pay_attention_to_ticker_not_symbol")?this._symbolInfo?this._symbolInfo.ticker:this.Z1.symbol.value():this.Z1.symbol.value();this.extendedHours.value()&&(a={symbol:a,session:"extended"});switch(this.Z1.style.value()){case TradingView.Series.STYLE_RENKO:var b=this.Z1.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.Z1.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.Z1.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.Z1.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.Z1.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.Z1.style.value());}};TradingView.Series.prototype.getInputsProperties=function(){var a=this.Z1[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,SEARCH_NEAREST_RIGHT);a=this.data().search(a.m_lastBar,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;var a=this.model().paneForSource(this).Z18();for(i=0;i<a.size();i++){var b=a.item(i);if(b instanceof TradingView.Study&&"Sessions"==b.metaInfo().shortId)return this._sessionsStudy=b}return!1};
|
|
TradingView.Series.prototype.createSessStudy=function(){if(!D76.enabled("charting_library")&&!this.sessionsStudy()){var a=StudyMetaInfo.findStudyMetaInfo(this.model().studiesMetaData(),"Sessions@tv-basicstudies");this.model().insertStudy(a,!1,!0);this.extendedHours.value()||this.disableSessionBackground();this._onSessionsStudyCreated.fire()}};TradingView.Series.prototype.checkSessStudy=function(){D76.enabled("charting_library")||(this.sessionsStudy()||this.createSessStudy(),this.sessionsStudy().start())};
|
|
TradingView.Series.prototype.disableSessionBackground=function(){this.sessionsStudy()&&(this.sessionsStudy().properties().graphics.backgrounds.inSession.visible.setValue(!1),this.sessionsStudy().properties().graphics.backgrounds.outOfSession.visible.setValue(!1))};TradingView.Series.prototype.isSpread=function(){return 1<this._symbolInfo.legs.length};TradingView.Series.prototype.firstSymbol=function(){return this._symbolInfo.legs[0]};TradingView.Series.prototype.firstShortName=function(){return Q68.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.Z1.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.Z1.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))};function SeriesDataWindowView(a,b){DataWindowView.call(this);this._series=a;this.D99=b;this._items.append(new DataWindowItem($.t("Open",{context:"in_legend"}),""));this._items.append(new DataWindowItem($.t("High",{context:"in_legend"}),""));this._items.append(new DataWindowItem($.t("Low",{context:"in_legend"}),""));this._items.append(new DataWindowItem($.t("Close",{context:"in_legend"}),""));this._invalidated=!0;this.update()}inherit(SeriesDataWindowView,DataWindowView);
|
|
SeriesDataWindowView.prototype.update=function(){this._invalidated=!0};
|
|
SeriesDataWindowView.prototype._updateImpl=function(){this._series.symbolInfo()?(this._header=[this._series.symbolInfo().name,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.D99.timeScale().isEmpty()&&
|
|
0!==this._series.bars().size()){var a=this._series.barColorer(),b=this.D99.crossHairSource().index,b=this._series.nearestIndex(b,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[OPEN_PLOT]));this._items.item(1).setValue(d.format(c[HIGH_PLOT]));this._items.item(2).setValue(d.format(c[LOW_PLOT]));this._items.item(3).setValue(d.format(c[CLOSE_PLOT]));a=a.barStyle(b,!1);for(b=0;4>b;b++)this._items.item(b).setColor(a.barColor)}}};
|
|
SeriesDataWindowView.prototype.items=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._items};SeriesDataWindowView.prototype.dump=function(){return{header:this._header,items:this._items}};SeriesDataWindowView.prototype.additional=function(){if(this._series.dataPoweredBy)return"(Data Provided by "+this._series.dataPoweredBy+")"};function D13(a,b){this.m_series=a;this.m_model=b;this.m_bars=new List;this._invalidated=!0}D13.prototype.update=function(){this._invalidated=!0};
|
|
D13.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(),SEARCH_NEAREST_RIGHT),d=this.m_series.nearestIndex(b.lastBar(),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=void 0;
|
|
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[OPEN_PLOT]&&void 0!=c[HIGH_PLOT]&&void 0!=c[LOW_PLOT]&&void 0!=c[CLOSE_PLOT]){void 0===e&&(e=c[CLOSE_PLOT]);var d=new BarItem;d.setTime(Math.round(b));g?(d.setOpen(100*(c[OPEN_PLOT]-e)/e),d.setHigh(100*(c[HIGH_PLOT]-e)/e),d.setLow(100*(c[LOW_PLOT]-e)/e),d.setClose(100*(c[CLOSE_PLOT]-e)/e)):(d.setOpen(c[OPEN_PLOT]),d.setHigh(c[HIGH_PLOT]),
|
|
d.setLow(c[LOW_PLOT]),d.setClose(c[CLOSE_PLOT]));k.value=c;var f=h.barStyle(b,!1,k);k.previousValue=c;d.color=f.barColor;d.borderColor=f.barBorderColor;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=(new SelectionIndexes).calc(c,d),this._selectionData={points:new List},this._selectionData.hittestResult=HitTestResult.REGULAR,c=0;c<b.size();c++){var d=
|
|
b.item(c),l=this.m_series.bars().valueAt(d);l&&(l=0.5*(l[OPEN_PLOT]+l[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.append(new MathEx.Point(d,l)))}}}}};D13.prototype.items=function(){return this.m_bars};D13.prototype.dump=function(){var a={};a.bars=this.m_bars;return a};
|
|
function D14(a,b){D13.call(this,a,b)}inherit(D14,D13);
|
|
D14.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 CompositeRenderer;b.append(new D55(a));this.m_series===this.m_model.selectedSource()&&b.append(new SelectionRenderer(this._selectionData));return b};
|
|
function D15(a,b){D13.call(this,a,b)}inherit(D15,D13);
|
|
D15.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 CompositeRenderer;b.append(new D56(a));
|
|
this.m_series===this.m_model.selectedSource()&&b.append(new SelectionRenderer(this._selectionData));return b};function D16(a,b){D13.call(this,a,b)}inherit(D16,D13);
|
|
D16.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 CompositeRenderer;b.append(new D56(a));
|
|
this.m_series===this.m_model.selectedSource()&&b.append(new SelectionRenderer(this._selectionData));return b};function D17(a,b){D13.call(this,a,b)}inherit(D17,D13);
|
|
D17.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 CompositeRenderer;b.append(new D56(a));this.m_series===this.m_model.selectedSource()&&b.append(new SelectionRenderer(this._selectionData));return b};function D28(a,b,c){this.m_series=a;this.m_priceSource=b;this.m_model=c;this.m_items=new List}
|
|
D28.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(),SEARCH_NEAREST_RIGHT),a=this.m_series.nearestIndex(a.lastBar(),SEARCH_NEAREST_LEFT),c=this.m_series[this.m_priceSource],d=this.m_series.bars(),e=this,f,g=e.m_series.priceScale();this.m_series.barColorer();
|
|
var h={color:this.m_series.properties().lineStyle.color.value()};d.range(b,a).each(function(a){var b=c.call(e.m_series,a);null!==b&&void 0!==b&&(f||(f=b),g.properties().percentage.value()&&(b=100*(b-f)/f),b=g.priceToCoordinate(b),a=e.m_model.timeScale().indexToCoordinate(a),a=new MathEx.Point(a,b),a.style=h,e.m_items.append(a))});if(this.m_series===this.m_model.selectedSource())for(b=(new SelectionIndexes).calc(b,a),this._selectionData={points:new List},this._selectionData.hittestResult=HitTestResult.REGULAR,
|
|
a=0;a<b.size();a++){var k=b.item(a),d=c.call(this.m_series,k);g.properties().percentage.value()&&(d=100*(d-f)/f);k=this.m_model.timeScale().indexToCoordinate(k);d=this.m_series.priceScale().priceToCoordinate(d);this._selectionData.points.append(new MathEx.Point(k,d))}}}};function D19(a,b,c){D28.call(this,a,b,c)}inherit(D19,D28);
|
|
D19.prototype.renderer=function(){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 D67(a),b;this.m_series===this.m_model.selectedSource()?(b=new CompositeRenderer,
|
|
b.append(a),b.append(new SelectionRenderer(this._selectionData))):b=a;return b};function D12(a,b,c){D28.call(this,a,b,c)}inherit(D12,D28);
|
|
D12.prototype.renderer=function(){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=generateColor(this.m_series.properties().areaStyle.color1.value(),b);a.color2=generateColor(this.m_series.properties().areaStyle.color2.value(),
|
|
b);a.bottom=this.m_series.priceScale().height();b=new CompositeRenderer;b.append(new D52(a));this.m_series===this.m_model.selectedSource()&&b.append(new SelectionRenderer(this._selectionData));return b};function SeriesStatusView(a,b){StatusView.call(this,b);this._series=a}inherit(SeriesStatusView,StatusView);SeriesStatusView.prototype.round=function(a,b){var c=Math.round(a*Math.pow(10,b))/Math.pow(10,b);return c?c:""};
|
|
SeriesStatusView.prototype.update=function(){this._series.symbolInfo()?this._text=this._series.symbolInfo().description:this._text=this._series.symbol();this._text+=", "+translatedIntervalString(this._series.interval());if(this._series.symbolInfo()&&this._series.symbolInfo().exchange){var a=this._series.symbolInfo().exchange;"forex"==this._series.symbolInfo().type&&(a="FX");this._text+=", "+a}a=this._series.Z1;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"};function SeriesPriceAxisView(a,b){this._series=a;this.D99=b;this._text="";this._coordinate=0;this._background="black";this._textHeight=14;this._invalidated=!0}inherit(SeriesPriceAxisView,PriceAxisView);SeriesPriceAxisView.prototype.update=function(){this._invalidated=!0};
|
|
SeriesPriceAxisView.prototype._updateImpl=function(a){this._text="";this._visible=!1;if(a=this._series.lastValueData())if(this._visible=!0,this._text=this._series.properties().showLastValue.value()?a.text:"",this._background=a.color,this._coordinate=a.coordinate,this._textHeight=this._series.priceScale().m_markBuilder.fontHeight(),this._countdown=null,D76.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)}};SeriesPriceAxisView.prototype.font=function(){return"11px Arial"};SeriesPriceAxisView.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,font:this.font(),secondLine:this._countdown};return new PriceAxisViewRenderer(a)};
|
|
SeriesPriceAxisView.prototype.dump=function(){return{text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:this._textHeight,visible:this._visible}};SeriesPriceAxisView.prototype.text=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.text.call(this)};function ProjectionSeriesPriceAxisView(a,b){SeriesPriceAxisView.call(this,a,b)}inherit(ProjectionSeriesPriceAxisView,SeriesPriceAxisView);ProjectionSeriesPriceAxisView.prototype.lastPrice=function(){return this._series.data().lastProjectionPrice};
|
|
ProjectionSeriesPriceAxisView.prototype._updateImpl=function(a){this._text="";this._visible=!1;if(!this.D99.timeScale().isEmpty()&&!this._series.priceScale().isEmpty()&&this.lastPrice()&&(a=this.D99.timeScale().visibleBars(),!a.isEmpty())){var b=this._series.data().search(a.lastBar(),SEARCH_NEAREST_LEFT);if(void 0!==b){a=this._series.nearestIndex(a.firstBar(),SEARCH_NEAREST_RIGHT);a=this._series.data().valueAt(a)[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_SHAPES:"shapes",PLOT_TYPE_CHARS:"chars",PLOT_TYPE_ARROWS:"arrows",PLOT_TYPE_DATAOFFSET:"dataoffset",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.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_CROSS,"shape.cross","Cross","D62");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_XCROSS,"shape.xcross","X Cross","D73");
|
|
TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_CIRCLE,"shape.circle","Circle","D58");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_TRIANGLE_UP,"shape.triangleup","Triangle Up","D71");TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_TRIANGLE_DOWN,"shape.triangledown","Triangle Down","D70");
|
|
TradingView.StudyPlotShapes.registerPlotShape(TradingView.StudyPlotShapes.SHAPE_FLAG,"shape.flag","Flag","D63");function D36(a,b,c,d){this.Z0=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))}D36.prototype.update=function(){this._visible=!1;var a=this.Z0.lastValueData(this._plotName,!0);a&&(this._visible=!0,this._points=(new List).append(new MathEx.Point(0,a.coordinate)),this._color=a.color)};
|
|
D36.prototype.renderer=function(){var a={};a.points=this._points;a.color=this._color;a.linewidth=this.Z0.properties().styles[this._plotName].linewidth.value();a.linestyle=CanvasEx.LINESTYLE_DOTTED;a.hitTestResult=HitTestResult.REGULAR;a.visible=this._visible;return new HorzLineRenderer(a)};
|
|
function defaultPlotOptions(){return{visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,plottype:TradingView.Study.PLOT_LINE,histogramBase:0,transparency:50,trackPrice:!1,joinPoints:!1}}TradingView.createStudy=function(a,b,c,d){var e="study_"+(d.classId||d.shortId);return TradingView[e]?new TradingView[e](a,b,c,d):new TradingView.Study(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 W51(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 W51(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>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(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));b=TradingView.convertMetainfoInputsArrayToObject(a);d={};Q0.mergeInputs(d,b.defaults.inputs);Q0.mergeInputsObjPart(d,e.inputs);Q0.mergeInputsArrPart(d,b.inputs);e.inputs=d;delete b.inputs;delete b.defaults.inputs;d={};TradingView.merge(d,b.defaults);TradingView.merge(d,factoryDefaults("study_"+b.id));TradingView.merge(d,e);TradingView.merge(d,b);delete d.defaults;e=d;a=TradingView.calcDefaultColorsOffset(c,
|
|
a);TradingView.merge(e,TradingView.shiftDefaultColors(e,a));return e};
|
|
TradingView.prepareStudyPropsStateForLoadChart=function(a,b,c,d,e){var f=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,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<=StudyMetaInfo.versionOf(a)&&(a=TradingView.convertMetainfoInputsArrayToObject(a),b={},Q0.mergeInputs(b,a.defaults.inputs),Q0.mergeInputs(b,g.inputs),Q0.mergeInputsArrPart(b,a.inputs),
|
|
g.inputs=b,delete a.inputs,delete a.defaults.inputs,b={},TradingView.merge(b,a.defaults),TradingView.merge(b,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.Study.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.Z18().size();d++){var e=a.Z18().item(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)if(color=a.styles[c].color)a.styles[c].color=TradingView.shiftColor(color,b);return a};TradingView.shiftColor=function(a,b){a=new RGBColor(a);var c=TradingView.rgbToHsl(a.r,a.g,a.b),d=c[0]+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._resolvedSymbols={};this._priceAxisViewsBase=new List;this._paneViews=new List;this._hlinesPriceAsisViews=new List;this._horizlinesPriceAsisViews=new List;PriceDataSource.call(this);this.m_data=new PlotList;this._graphics=new Q62(d);this._plotOffsets={};this._plotOffsetsMetaInfoOverride={};this.D99=a;this._chartApi=a._chartApi;this._series=c;this._metaInfo=d;this.Z1=b;this.Z1.listeners().subscribe(this,TradingView.Study.prototype.changeStyles);
|
|
void 0!=this.Z1.inputs&&this.Z1.inputs.listeners().subscribe(this,TradingView.Study.prototype.inputsChanged);this._turnaroundCounter=1;this._turnaround="st"+this._turnaroundCounter;this._status="";this._plotFields=[];if(b=this.metaInfo().plots)for(c=0,d=b.length;c<d;c++)this._plotFields.push(b[c].id);this.clearData();this._studyModified=!1;this._tagsChanged=new Delegate;this.createViews();var e=this;this._handler=function(a){e.onData(a)};this._createFormatter();e=this;this.Z1.precision.listeners().subscribe(null,
|
|
function(){e._createFormatter()});D76.enabled("update_study_formatter_on_symbol_resolve")&&a.mainSeries().onSymbolResolved().subscribe(null,function(){e._createFormatter()});this.Z1.precision.listeners().subscribe(null,function(){e.D99.Z19(new Q22(Q22.FULL_UPDATE))});this.Z1.showInDataWindow.listeners().subscribe(a,D78.prototype.fullUpdate)};inherit(TradingView.Study,PriceDataSource);
|
|
TradingView.merge(TradingView.Study,TradingView.StudyConsts);
|
|
TradingView.Study.prototype.lastValueData=function(a,b,c){var d={};if(this.D99.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return null;var e=this.D99.timeScale().visibleBars();if(e.isEmpty())return null;var f;for(f=0;f<this.metaInfo().plots.length&&this.metaInfo().plots[f].id!==a;f++);if(!this.properties().visible.value()||!this.properties().styles[a].visible.value())return null;var g=this.offset(a),e=this.nearestIndex(e.lastBar()-g,SEARCH_NEAREST_LEFT);
|
|
if(void 0===e)return null;this.data();b=b?this.data().last().value:this.data().valueAt(e);if(!b||!isNumber(b[f+1]))return null;for(var g=this.metaInfo().plots,e=null,h=0;h<g.length;h++)this.isSelfColorerPlot(h)&&g[h].target===a&&(e=h,this.metaInfo(),paletterProps=this.properties().palettes[g[h].palette]);f=b[f+1];c&&(d.price=f);if(this.priceScale().properties().percentage.value()){c=this.firstValue(!0);if(!c)return null;f=this.priceScale().priceRange().convertToPercent(f,c)}d.text=this.priceScale().formatter().format(f);
|
|
a=this.properties().styles[a].color.value();e&&b.length>e+1?(c=b[e+1],d.color=void 0!=c?paletterProps.colors[c].color.value():a):d.color=a;d.coordinate=this.priceScale().priceToCoordinate(f);d.item=b;return d};TradingView.Study.prototype.series=function(){return this._series};TradingView.Study.prototype.model=function(){return this.D99};
|
|
TradingView.Study.prototype.clearData=function(){this.m_data=new PlotList(this._plotFields);this._graphics=new Q62(this._metaInfo);this._plotOffsets={}};TradingView.Study.prototype.onTagsChanged=function(){return this._tagsChanged};TradingView.Study.prototype.properties=function(){return this.Z1};
|
|
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 StudyMetaInfo?b.metaInfo=this.metaInfo().state():(b.metaInfo=$.extend({},this.metaInfo()),b.metaInfo.id=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._restarting=!0;D76.enabled("stop_study_on_restart")&&this.stop();this.start()};
|
|
TradingView.Study.prototype.stop=function(){this._chartApi&&this._chartApi.connected()&&this._studyId&&this._chartApi.removeStudy(this._studyId,this._handler);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.D99.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.Z1.inputs[c].value();this._resolvedSymbols[d]||(a=!1,this._resolveSymbol(d,this.Z1.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.Z1.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"}inputs=[inputs[0],inputs[1]]}a+="-"+(this._metaInfo.version||"1!");a=StudyMetaInfo.cutDollarHash(a);"Script@tv-scripting-1"===a&&(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)[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,allowScriptCompile:!1})};
|
|
TradingView.Study.prototype.inputsForAlert=function(){var a=this.offset(),b=this.inputs({symbolsForDisplay:!0,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,allowScriptCompile:!0});a&&b.push(a);return b};TradingView.Study.prototype.inputs=function(a){var b={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!0,allowScriptCompile:!0};TradingView.merge(b,a);return this._buildInputs(b)};
|
|
TradingView.Study.prototype._buildInputs=function(a){assert(!!a,"options not set");try{var b=this._prepareInputs(a)}catch(c){console.warn("Failed to prepare study inputs: "+c),b={}}if(!a.symbolsForDisplay&&this._metaInfo.isTVScript){if(0==Object.keys(b).length||this._metaInfo.isTVScriptStub)return[this._metaInfo.defaults.inputs.text];var d=null,e=this._metaInfo.TVScriptSourceCode;a.allowScriptCompile&&window.scriptLib&&e&&(d=scriptLib.processScriptInputsChanged(e,this._metaInfo.version,b,this));return[Q57.patchILTemplate(d||
|
|
this._metaInfo.defaults.inputs.text,this._metaInfo,b)]}if(a.asObject){var f={};Object.keys(b).forEach(function(a){null!=b[a]&&(f[a]=b[a])});f=$.isEmptyObject(f)?null:f}else f=[],Object.keys(b).forEach(function(a){null!=b[a]&&f.push(b[a])});return f};
|
|
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.Z1.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.Z1.inputs[c].value();if(0>c)var d=
|
|
this._rightOffsetToUnixTime(-c),c=d&&0<=d?d:c;return c}return this.Z1.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()};
|
|
TradingView.Study.prototype.changeStyles=function(){if(this._inputs)for(var a=this.inputs({allowScriptCompile:!1}),b=0;b<a.length;b++){if(a[b]!==this._inputs[b]){this._changeInputs(a);break}}else this.restart();this.createViews();this.recalculate(!0);this.updateAllViews()};
|
|
TradingView.Study.prototype.inputsChanged=function(){if(this._metaInfo.isTVScript){var a=this._prepareInputs({symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!0,allowScriptCompile:!0});TVScript.TvsTranslator.patchProperties(this.Z1,this._metaInfo,a);this.createViews();this.recalculate(!0);this.updateAllViews()}};
|
|
TradingView.Study.prototype.createViews=function(){this._priceAxisViewsBase=new List;this._paneViews=new List;if(this.metaInfo().plots)for(var a=0;a<this.metaInfo().plots.length;a++)if(!this.isSelfColorerPlot(a)&&!this.isBarColorerPlot(a)){var b=this.metaInfo().plots[a].id;this.isBgColorerPlot(a)?this._paneViews.append(new D29(this,this._series,this.D99,b)):this.isPlotShapesPlot(a)?this._paneViews.append(new D35(this,this._series,this.D99,b)):this.isPlotCharsPlot(a)?
|
|
this._paneViews.append(new D34(this,this._series,this.D99,b)):this.isPlotArrowsPlot(a)?this._paneViews.append(new D33(this,this._series,this.D99,b)):(this._priceAxisViewsBase.append(new D50(this,this.D99,b)),this._paneViews.append(new D32(this,this._series,this.D99,b)),this.properties().styles[b].trackPrice.value()&&this._paneViews.append(new D36(this,this._series,this.D99,b)))}if(this.Z1.bands)for(a=
|
|
0;a<this.Z1.bands.childCount();a++)this.Z1.bands[a].visible.value()&&this._paneViews.append(new TradingView.W57(this.Z1.bands[a],this));this.Z1.bandsBackground&&this._paneViews.append(new TradingView.W56(this));a=[];this.metaInfo().graphics&&(a=Object.keys(this.metaInfo().graphics),a.sort(function(a,b){return TradingView.Study.graphicsZOrderPriority(a)-TradingView.Study.graphicsZOrderPriority(b)}));for(var c in a){var b=a[c],d="_paneView"+
|
|
b,e="StudyPaneView_"+b;TradingView.Study[e]&&(this[d]=new TradingView.Study[e](this,this.D99),this._paneViews.append(this[d]));this._dataWindowView||"hhists"!==b||(this._dataWindowView=new StudyHHistsDataWindowView(this,this.D99))}this.Z1.areaBackground&&this._paneViews.append(new TradingView.W54(this));if(this.Z1.filledAreas&&this._metaInfo.filledAreas)for(a=0;a<this._metaInfo.filledAreas.length;++a)c=this._metaInfo.filledAreas[a],b=this.Z1.filledAreasStyle[c.id],
|
|
c.type===StudyMetaInfo.FilledArea.TYPE_PLOTS?this._paneViews.append(new TradingView.D1(this,c,b)):c.type===StudyMetaInfo.FilledArea.TYPE_HLINES?this._paneViews.append(new TradingView.W83(this,c,b)):console.warn("Unsupported filledArea type: "+c.type);this._dataWindowView||(this._dataWindowView=new StudyDataWindowView(this,this.D99));this._statusView||(this._statusView=new StudyStatusView(this,this.D99.properties()));this._priceAxisViews=(new List).appendAll(this._priceAxisViewsBase).appendAll(this._hlinesPriceAsisViews).appendAll(this._horizlinesPriceAsisViews)};
|
|
TradingView.Study.prototype.recalculate=function(a){var b=this.D99.paneForSource(this);this.D99.recalculatePane(b,a);this.D99.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){a=a?this._metaInfo.shortDescription||this.Z1.shortDescription&&this.Z1.shortDescription.value()||"Study":this._metaInfo.description||this.Z1.description&&this.Z1.description.value()||"Study";a=$.t(a);var b=this.properties().showStudyArguments.value(),c=this.inputsForGUI()||[];b&&0<c.length&&(a+=" ("+c.join(", ")+")");return a};TradingView.Study.prototype.graphics=function(){return this._graphics.graphics()};
|
|
TradingView.Study.prototype._checkTurnaround=function(a){return a===this._turnaround||a===this.D99.mainSeries()._turnaround||a===this.D99.mainSeries()._turnaround+"_"+this._turnaround};
|
|
TradingView.Study.prototype.onData=function(a){switch(a.method){case "study_loading":this._status=$.t("loading...");this._failed=!1;this._statusView.update();this.D99.updateSource(this);break;case "study_error":this._failed=!0;this.clearData();this._status=a.params[2]?$.t(a.params[2].split(":",2)[0]):"";this._statusView.update();this.D99.updateSource(this);break;case "study_completed":if(!this._checkTurnaround(a.params[1]))break;this._status="";this._statusView.update();a=this.D99.paneForSource(this);
|
|
this.D99.recalculatePane(a,!0);this._updateSources();this.D99.Z19(new Q22(Q22.FULL_UPDATE));break;case "data_update":if(!this._checkTurnaround(a.params.turnaround))break;this._studyModified&&(this.clearData(),this._studyModified=!1);var b=0==this.m_data.size();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._mergeData(a.params.plots);this._graphics.process(a.params.nonseries);this._postProcessGraphics();a=this.D99.paneForSource(this);this.D99.recalculatePane(a,b);this._updateSources()}};TradingView.Study.prototype._updateSources=function(){this.D99.updateSource(this);this.hasBarColorer()&&this.D99.updateSource(this.D99.mainSeries())};TradingView.Study.prototype._processPlotOffsets=function(a){a=a.nonseries.d;a&&a.indexes_replace||(this._plotOffsets=a&&a.offsets?a.offsets:{})};
|
|
TradingView.Study.prototype._mergeData=function(a){this.m_data.merge(a)};
|
|
TradingView.Study.prototype._postProcessGraphics=function(){var a=this,b=function(b){var d=a._graphics.graphics(),e=new List,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.append(new TradingView.Study.StudyPriceAxisView_hlines(a,a.D99,g[d].data[f],g[d].styleId,b));return e};this._hlinesPriceAsisViews=b("hlines");this._horizlinesPriceAsisViews=b("horizlines");this._priceAxisViews=(new List).appendAll(this._priceAxisViewsBase).appendAll(this._hlinesPriceAsisViews).appendAll(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.D99.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.prototype.offset=function(a){var b=0;this._plotOffsets&&void 0!=this._plotOffsets[a]&&(b+=this._plotOffsets[a]);void 0!=this._plotOffsetsMetaInfoOverride[a]?b+=this._plotOffsetsMetaInfoOverride[a]:this.properties().offsets&&void 0!=this.properties().offsets[a]&&(b+=this.properties().offsets[a].val.value());this.properties().offset&&(b+=this.properties().offset.val.value());return b};
|
|
TradingView.Study.prototype.priceRange=function(a,b){if(isInteger(a)){if(isInteger(b)){if(0===this.m_data.size())return null;var c=null;if(0==this._metaInfo.plots.length)return null;for(var d=0;d<this._metaInfo.plots.length;++d)if(this.isLinePlot(d)||this.isPlotShapesPlot(d)||this.isPlotCharsPlot(d)){var e=this._metaInfo.plots[d].id;if(this.properties().styles[e].visible.value()){for(var f=this.offset(e),f=this.m_data.range(a-f,b-f),g=f._start;g<f._end;++g){var h=f._valueAt(g)[d+1];void 0!=h&&(void 0==
|
|
c?c=new PriceRange(h,h):c.apply(h,h))}f=this.properties().styles[e].plottype.value();!this.properties().skipHistogramBaseOnAutoScale&&0<=[TradingView.Study.PLOT_HISTOGRAM,TradingView.Study.PLOT_COLUMNS,TradingView.Study.PLOT_AREA].indexOf(f)&&(h=this.properties().styles[e].histogramBase.value(),isNumber(h)&&(c?c.apply(h,h):c=PriceRange(h,h)))}}if(this._metaInfo.bands)for(d=0;d<this._metaInfo.bands.length;d++)this.properties().bands[d].visible.value()&&(h=this.properties().bands[d].value.value(),isNumber(h)&&
|
|
(c?c.apply(h,h):c=PriceRange(h,h)));c&&c.minValue()===c.maxValue()&&(d=0.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.logDebug("Study.priceRange: incorrect endBar")}else TradingView.logDebug("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.D99.paneForSource(this)===a&&b===this.priceScale()&&this.properties().showLastValue.value()?this._priceAxisViews:null};
|
|
TradingView.Study.prototype.isLinePlot=function(a){return this._metaInfo.plots[a].type==TradingView.Study.PLOT_TYPE_LINE};TradingView.Study.prototype.isSelfColorerPlot=function(a){return this._metaInfo.plots[a].type==TradingView.Study.PLOT_TYPE_COLORER};TradingView.Study.prototype.isBarColorerPlot=function(a){return this._metaInfo.plots[a].type==TradingView.Study.PLOT_TYPE_BAR_COLORER};TradingView.Study.prototype.isBgColorerPlot=function(a){return this._metaInfo.plots[a].type==TradingView.Study.PLOT_TYPE_BG_COLORER};
|
|
TradingView.Study.prototype.isPlotShapesPlot=function(a){return this._metaInfo.plots[a].type==TradingView.Study.PLOT_TYPE_SHAPES};TradingView.Study.prototype.isPlotCharsPlot=function(a){return this._metaInfo.plots[a].type==TradingView.Study.PLOT_TYPE_CHARS};TradingView.Study.prototype.isPlotArrowsPlot=function(a){return this._metaInfo.plots[a].type==TradingView.Study.PLOT_TYPE_ARROWS};TradingView.Study.prototype.isDataOffsetPlot=function(a){return this._metaInfo.plots[a].type==TradingView.Study.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 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 VolumeFormatter(a)):this._formatter=new 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(isInteger(a)){var c=this._series.data().bars().search(a,b);return c?c.index:void 0}TradingView.logDebug("Study.nearestIndex: incorrect logicalPoint")};
|
|
TradingView.Study.prototype.updateAllViews=function(){for(var a=0;a<this._paneViews.size();a++)this._paneViews.item(a).update();this._dataWindowView.update();this._statusView.update();for(a=0;a<this._priceAxisViews.size();a++)this._priceAxisViews.item(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 Q63};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};PineAddons.SpyderCrusherStudiesMetaInfo=[{_metainfoVersion:27,isTVScript:!0,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_1:{transparency:90},plot_2:{visible:!0,location:"Absolute",transparency:70,"char":"\u25a0",color:"#00FF00"},plot_3:{visible:!0,location:"Absolute",transparency:70,"char":"\u25a0",color:"#FF0000"},plot_4:{visible:!0,location:"Absolute",transparency:35,"char":"\u25c6",color:"#FF0000"},plot_5:{visible:!0,location:"Absolute",transparency:35,"char":"\u25c6",color:"#00FF00"},
|
|
plot_6:{visible:!0,location:"BelowBar",transparency:35,"char":"P",color:"#0000FF"},plot_7:{visible:!0,location:"AboveBar",transparency:35,"char":"P",color:"#0000FF"},plot_8:{visible:!0,location:"BelowBar",transparency:35,"char":"\u0298",color:"#0000FF"},plot_9:{visible:!0,location:"AboveBar",transparency:35,"char":"X",color:"#FF0000"},plot_10:{visible:!0,location:"AboveBar",transparency:35,"char":"X",color:"#FF0000"},plot_11:{visible:!0,location:"BelowBar",transparency:35,"char":"Z",color:"#008000"}},
|
|
precision:0,palettes:{palette_0:{colors:{0:{color:"#FFFF00",width:1,style:0},1:{color:"#800080",width:1,style:0},2:{color:"#FF7F00",width:1,style:0},3:{color:"#808000",width:1,style:0},4:{color:"#0066FF",width:1,style:0},5:{color:"#FF00FF",width:1,style:0},6:{color:"#758A0A",width:1,style:0},7:{color:"#008000",width:1,style:0},8:{color:"#00FF00",width:1,style:0},9:{color:"#FF0000",width:1,style:0},10:{color:"#9FB4B4",width:1,style:0}}},palette_1:{colors:{0:{color:"#1A1A1A",width:1,style:0}}}},inputs:{text:"3.5/(#1+1)~nz($1@1)-nz(#0@#1)+#0~na(#0@#1)?na:$1/#1~na($3@1)?$2:(#0-$3@1)*$0+$3@1~$3;2/(#1+1)~nz($1@1)-nz(#0@#1)+#0~na(#0@#1)?na:$1/#1~na($3@1)?$2:(#0-$3@1)*$0+$3@1~$3;$1(#0,i:16)-$0(#0,i:16);#0<0&>75?1:0;$0(#0,i:16)-$1(#0,i:16);#0>0&<25?1:0;iff(#0,$1(#1,i:16),$0(#1,i:16));#0@3<#1&@2<#3&@1<#5&>#7;#0@3>#1&@2>#3&@1>#5&<#7;#0@2>#1&<#3@1&<#5&>#7&<#9&
<#11@1;#0@4<#1&@3<#3&@2<#5&@1>#7&>#9&
<#11@1||#12@5<#13&@4<#15&@3<#17&@2>#19&<#21&@1>#23&>#25&<#27@1&>#29;#0@1<#1&>#3&<#5&>#7;#0@2>#1&@1<#3&@1<#5&<#7@1&<#9&
>#11@1&>#13@1||#14@2>#15&@1<#17&@1>#19&>#21@1&<#23||#24@2>#25&@1<#27&@1>#29@2&&(#30>#31@1||#32>#33@2)&">#35@2&$<#37;#0@1<#1&@2>#3&@1<#5&@1>#7&<#9@1&
>#11&&(#12<#13||#14<#15@1)&>#17@1&<#19||#20@4>#21&@3<#23&@1>#25&>#27&@1<#29&>#31& >#33@1;#0>#1+0.01&<#3&@1>#5&@1>#7@1&>#9;#0@1<#1&>$1(#3,i:16)&<#5@1;#0>$1(#1,i:16);#0<$1(#1,i:16);#0>$1(#1,i:16)&<$1(#3,i:16)||#4>$1(#5,i:16)&@1<$1(#7,i:16);#0?0:#1?1:#2?2:#3?3:#4?4:#5?5:#6?5:#7?6:#8?7:#9?8:#10?9:#11?10:na;#0||#1||#2||#3;#0==1&>=#2@1;#0==2&@1>#2@2&<#3&&(#2<#2@1||#1<#2@2);#0==2&@1<#2@2&@1>#3@1&&(#3@1>#4||#1>#4)&>#2@2;#0==3&@2>#2@3&@1>#2@3&@1>#3&@2>#4@4&>#1&<#5@2&<#5@3||#6==3&@2<=#2@3&@1>#2@3&@1>#7&@2>#4@4&<=#2@1&>#1&<min(#5@3,#1@2);#0||#1;#0<=3&<$1(#2,i:16)&@1>#3||#4<=4&<#5&<#7&<min(#8@3,#1@2);iff(#0||#1||#2||#3,na,#4);#0&iff(#0<=3&>#2@1&<#1&>max(#1@4,#2@4)||#4<=3&>#2@1&<#1&>max(#1@4,#2@5),1.0,0.0);!#0;abs(#0@3>#1@3&�@2>#1@2&�@1>#1@1&�<#1||#0@3>#1@3&�@2>#1@2&�@1<#1@1&�>#1||#0@3>#1@3&�@2<#1@2&�@1>#1@1&�>#1||#0@3<#1@3&�@2>#1@2&�@1>#1@1&�>#1||#0@3>#1@3&�@2>#1@2&�@1>#1@1&�>#1)*#2*0.9999525;abs(#0@3<#1@3&�@2<#1@2&�@1<#1@1&�>#1||#0@3<#1@3&�@2<#1@2&�@1>#1@1&�<#1||#0@3<#1@3&�@2>#1@2&�@1<#1@1&�<#1||#0@3>#1@3&�@2<#1@2&�@1<#1@1&�<#1||#0@3<#1@3&�@2<#1@2&�@1<#1@1&�<#1)*#2*1.00009525;abs(#0>$1(#1,i:16)&�<#2)*#1*0.9999525;abs(#0<$1(#1,i:16)&�>#2)*#1*1.00009525;#0?0:na;#0?#1:na;#0&>#2?#3:na;#0&<#2?#3:na;#0?#1&:na;b:<in_0>~b:<in_1>~b:<in_2>~b:<in_3>~$2(low)~percentrank($44,8)~$3($44,$45)~$4(high)~percentrank($47,8)~$5($47,$48)~$6($49,high)~offset($50,1)~offset($50,2)~offset($50,3)~offset($50,4)~$6($46,low)~offset($55,1)~offset($55,2)~offset($55,3)~offset($55,4)~offset($55,5)~low~lowest($61,2)~lowest($61,3)~offset($62,1)~offset($62,2)~offset($63,1)~high~highest($67,2)~highest($67,3)~offset($68,1)~offset($69,1)~offset($69,2)~close~lowest($73,3)~offset($74,1)~$58~$57~$56~$50~$7($73,$76,$73,$77,$73,$78,$73,$79)~$53~$52~$51~$55~$8($73,$81,$73,$82,$73,$83,$73,$84)~$66~open~$9($73,$82,$73,$73,$73,$79,$73,$86,$73,$87,$73,$61)~$59~$64~$60~$65~$10($73,$89,$73,$76,$73,$77,$73,$83,$73,$90,$73,$67,$73,$91,$73,$89,$73,$76,$73,$82,$73,$79,$73,$92,$73,$90,$73,$67,$87,$73)~$11($73,$78,$73,$84,$73,$79,$73,$87)~$12($73,$77,$61,$78,$73,$78,$67,$67,$73,$84,$61,$61,$73,$73,$61,$77,$61,$78,$73,$78,$73,$61,$73,$84,$73,$77,$73,$77,$61,$61,$73,$61,$73,$61,$61,$61,$73,$84)~$54~$72~$13($73,$83,$73,$77,$61,$78,$73,$78,$67,$67,$67,$84,$73,$84,$73,$73,$73,$61,$87,$73,$73,$96,$73,$76,$73,$83,$73,$79,$73,$97,$87,$73,$73,$61)~$71~$14($67,$99,$73,$87,$73,$83,$73,$87,$73,$84)~$15($73,$83,$73,$67,$73,$67)~$16($73,$67)~$17($73,$61)~$18($73,$61,$73,$67,$73,$67,$73,$61)~$19($80,$85,$88,$93,$94,$95,$98,$100,$101,$102,$103,$104)!$20($88,$93,$98,$95)~barssince($94)~$21($107,close,high)~$22($107,close,high,open)~$23($107,close,high,low,$66)~$24($107,close,high,$63,low,open,$107,$63)~$25($108,$110)~$25($109,$111)~$1(low,i:16)~offset($114,1)~barssince($112)~$26($116,close,low,$115,$116,$75,high,$70,open)~offset($117,1)~offset($117,2)~offset($117,3)~offset($117,4)~$27($118,$119,$120,$121,$117)~barssince($113)~$28($117,$122)~barssince($124)~$29($123,close,high,open,$125)~$30($94)~$31(close,open,low)~$32(close,open,high)~$33(close,low,$55)~$34(close,high,$50)~$35(b:$40)!$36(b:$43,$128)!$36(b:$43,$129)!$36(b:$43,$130)!$36(b:$43,$131)!$37(b:$41,close,open,$106)!$38(b:$41,close,open,$106)!$36(b:$42,$112)!$36(b:$42,$113)!$39(b:$42,$117,$122)!$39(b:$42,$126,$127)",
|
|
in_0:!1,in_1:!0,in_2:!0,in_3:!0}},plots:[{id:"plot_0",palette:"palette_0",type:"bar_colorer"},{id:"plot_1",palette:"palette_1",type:"bg_colorer"},{id:"plot_2",type:"chars"},{id:"plot_3",type:"chars"},{id:"plot_4",type:"chars"},{id:"plot_5",type:"chars"},{id:"plot_6",type:"chars"},{id:"plot_7",type:"chars"},{id:"plot_8",type:"chars"},{id:"plot_9",type:"chars"},{id:"plot_10",type:"chars"},{id:"plot_11",type:"chars"}],styles:{plot_2:{title:"75% Rule Up"},plot_3:{title:"75% Rule Down"},plot_4:{title:"Bearish Trend Near"},
|
|
plot_5:{title:"Bullish Trend Near"},plot_6:{title:"Pivot, Bullish Bias"},plot_7:{title:"Pivot, Bearish Bias"},plot_8:{title:"Confirmed Reversal Up"},plot_9:{title:"Confirmed Reversal Cancellation"},plot_10:{title:"Confirmed Reversal Cancellation"},plot_11:{title:"Confirmed Reversal Valid"}},description:"SCMR Trends\u2122",shortDescription:"SCMR Trends\u2122",is_price_study:!0,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"},2:{name:"Color 2"},3:{name:"Color 3"},4:{name:"Color 4"},
|
|
5:{name:"Color 5"},6:{name:"Color 6"},7:{name:"Color 7"},8:{name:"Color 8"},9:{name:"Color 9"},10:{name:"Color 10"}},addDefaultColor:!0},palette_1:{colors:{0:{name:"Color 0"}},addDefaultColor:!0}},inputs:[{defval:"3.5/(#1+1)~nz($1@1)-nz(#0@#1)+#0~na(#0@#1)?na:$1/#1~na($3@1)?$2:(#0-$3@1)*$0+$3@1~$3;2/(#1+1)~nz($1@1)-nz(#0@#1)+#0~na(#0@#1)?na:$1/#1~na($3@1)?$2:(#0-$3@1)*$0+$3@1~$3;$1(#0,i:16)-$0(#0,i:16);#0<0&>75?1:0;$0(#0,i:16)-$1(#0,i:16);#0>0&<25?1:0;iff(#0,$1(#1,i:16),$0(#1,i:16));#0@3<#1&@2<#3&@1<#5&>#7;#0@3>#1&@2>#3&@1>#5&<#7;#0@2>#1&<#3@1&<#5&>#7&<#9&
<#11@1;#0@4<#1&@3<#3&@2<#5&@1>#7&>#9&
<#11@1||#12@5<#13&@4<#15&@3<#17&@2>#19&<#21&@1>#23&>#25&<#27@1&>#29;#0@1<#1&>#3&<#5&>#7;#0@2>#1&@1<#3&@1<#5&<#7@1&<#9&
>#11@1&>#13@1||#14@2>#15&@1<#17&@1>#19&>#21@1&<#23||#24@2>#25&@1<#27&@1>#29@2&&(#30>#31@1||#32>#33@2)&">#35@2&$<#37;#0@1<#1&@2>#3&@1<#5&@1>#7&<#9@1&
>#11&&(#12<#13||#14<#15@1)&>#17@1&<#19||#20@4>#21&@3<#23&@1>#25&>#27&@1<#29&>#31& >#33@1;#0>#1+0.01&<#3&@1>#5&@1>#7@1&>#9;#0@1<#1&>$1(#3,i:16)&<#5@1;#0>$1(#1,i:16);#0<$1(#1,i:16);#0>$1(#1,i:16)&<$1(#3,i:16)||#4>$1(#5,i:16)&@1<$1(#7,i:16);#0?0:#1?1:#2?2:#3?3:#4?4:#5?5:#6?5:#7?6:#8?7:#9?8:#10?9:#11?10:na;#0||#1||#2||#3;#0==1&>=#2@1;#0==2&@1>#2@2&<#3&&(#2<#2@1||#1<#2@2);#0==2&@1<#2@2&@1>#3@1&&(#3@1>#4||#1>#4)&>#2@2;#0==3&@2>#2@3&@1>#2@3&@1>#3&@2>#4@4&>#1&<#5@2&<#5@3||#6==3&@2<=#2@3&@1>#2@3&@1>#7&@2>#4@4&<=#2@1&>#1&<min(#5@3,#1@2);#0||#1;#0<=3&<$1(#2,i:16)&@1>#3||#4<=4&<#5&<#7&<min(#8@3,#1@2);iff(#0||#1||#2||#3,na,#4);#0&iff(#0<=3&>#2@1&<#1&>max(#1@4,#2@4)||#4<=3&>#2@1&<#1&>max(#1@4,#2@5),1.0,0.0);!#0;abs(#0@3>#1@3&�@2>#1@2&�@1>#1@1&�<#1||#0@3>#1@3&�@2>#1@2&�@1<#1@1&�>#1||#0@3>#1@3&�@2<#1@2&�@1>#1@1&�>#1||#0@3<#1@3&�@2>#1@2&�@1>#1@1&�>#1||#0@3>#1@3&�@2>#1@2&�@1>#1@1&�>#1)*#2*0.9999525;abs(#0@3<#1@3&�@2<#1@2&�@1<#1@1&�>#1||#0@3<#1@3&�@2<#1@2&�@1>#1@1&�<#1||#0@3<#1@3&�@2>#1@2&�@1<#1@1&�<#1||#0@3>#1@3&�@2<#1@2&�@1<#1@1&�<#1||#0@3<#1@3&�@2<#1@2&�@1<#1@1&�<#1)*#2*1.00009525;abs(#0>$1(#1,i:16)&�<#2)*#1*0.9999525;abs(#0<$1(#1,i:16)&�>#2)*#1*1.00009525;#0?0:na;#0?#1:na;#0&>#2?#3:na;#0&<#2?#3:na;#0?#1&:na;b:<in_0>~b:<in_1>~b:<in_2>~b:<in_3>~$2(low)~percentrank($44,8)~$3($44,$45)~$4(high)~percentrank($47,8)~$5($47,$48)~$6($49,high)~offset($50,1)~offset($50,2)~offset($50,3)~offset($50,4)~$6($46,low)~offset($55,1)~offset($55,2)~offset($55,3)~offset($55,4)~offset($55,5)~low~lowest($61,2)~lowest($61,3)~offset($62,1)~offset($62,2)~offset($63,1)~high~highest($67,2)~highest($67,3)~offset($68,1)~offset($69,1)~offset($69,2)~close~lowest($73,3)~offset($74,1)~$58~$57~$56~$50~$7($73,$76,$73,$77,$73,$78,$73,$79)~$53~$52~$51~$55~$8($73,$81,$73,$82,$73,$83,$73,$84)~$66~open~$9($73,$82,$73,$73,$73,$79,$73,$86,$73,$87,$73,$61)~$59~$64~$60~$65~$10($73,$89,$73,$76,$73,$77,$73,$83,$73,$90,$73,$67,$73,$91,$73,$89,$73,$76,$73,$82,$73,$79,$73,$92,$73,$90,$73,$67,$87,$73)~$11($73,$78,$73,$84,$73,$79,$73,$87)~$12($73,$77,$61,$78,$73,$78,$67,$67,$73,$84,$61,$61,$73,$73,$61,$77,$61,$78,$73,$78,$73,$61,$73,$84,$73,$77,$73,$77,$61,$61,$73,$61,$73,$61,$61,$61,$73,$84)~$54~$72~$13($73,$83,$73,$77,$61,$78,$73,$78,$67,$67,$67,$84,$73,$84,$73,$73,$73,$61,$87,$73,$73,$96,$73,$76,$73,$83,$73,$79,$73,$97,$87,$73,$73,$61)~$71~$14($67,$99,$73,$87,$73,$83,$73,$87,$73,$84)~$15($73,$83,$73,$67,$73,$67)~$16($73,$67)~$17($73,$61)~$18($73,$61,$73,$67,$73,$67,$73,$61)~$19($80,$85,$88,$93,$94,$95,$98,$100,$101,$102,$103,$104)!$20($88,$93,$98,$95)~barssince($94)~$21($107,close,high)~$22($107,close,high,open)~$23($107,close,high,low,$66)~$24($107,close,high,$63,low,open,$107,$63)~$25($108,$110)~$25($109,$111)~$1(low,i:16)~offset($114,1)~barssince($112)~$26($116,close,low,$115,$116,$75,high,$70,open)~offset($117,1)~offset($117,2)~offset($117,3)~offset($117,4)~$27($118,$119,$120,$121,$117)~barssince($113)~$28($117,$122)~barssince($124)~$29($123,close,high,open,$125)~$30($94)~$31(close,open,low)~$32(close,open,high)~$33(close,low,$55)~$34(close,high,$50)~$35(b:$40)!$36(b:$43,$128)!$36(b:$43,$129)!$36(b:$43,$130)!$36(b:$43,$131)!$37(b:$41,close,open,$106)!$38(b:$41,close,open,$106)!$36(b:$42,$112)!$36(b:$42,$113)!$39(b:$42,$117,$122)!$39(b:$42,$126,$127)",
|
|
id:"text",name:"ILScript",type:"text",isHidden:!0},{id:"in_0",name:"-----\x3e High Contrast. Automatic Dark Background",defval:!1,type:"bool",isFake:!0},{id:"in_1",name:"Show Pivots Text",defval:!0,type:"bool",isFake:!0},{id:"in_2",name:"Show Confirmed Upside Reversals Text",defval:!0,type:"bool",isFake:!0},{id:"in_3",name:"Show Early Detection",defval:!0,type:"bool",isFake:!0}],id:"Script$SPYDERCR_SCMR_Trends@tv-scripting-1",scriptIdPart:"SPYDERCR_SCMR_Trends"},{_metainfoVersion:27,isTVScript:!0,
|
|
isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:3,plottype:6,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:3,plottype:6,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:2,inputs:{text:"#0>#0@1&>#1@1&>#3||#0>#0@1&>#2@2&>#3;#0<#0@1&<#1@1&<#3||#1<#1@1&<#2@2&<#4||#0<#0@1&<#1@2&<#4;#0?#1:na;t:<in_0>~t:tickerid~sym($4,$3,$3,0)|$0(high,low,close,open)~$6|sym($4,$3,$3,0)|close~lowest($10,2)~offset($11,1)~$1(high,low,close,open,$12)~$13|sym($4,$3,$3,0)|$0(high,low,close,open)~$7~$2($18,low)~$19|$20~sym($4,$3,$3,0)|close~lowest($24,2)~offset($25,1)~$1(high,low,close,open,$26)~$14~$2($28,high)~$29|$30~$32!$22",
|
|
in_0:"1M",in_1:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"B2B Dynamic Resistance\u2122",histogramBase:0,joinPoints:!1},plot_1:{title:"B2B Dynamic Support\u2122",histogramBase:0,joinPoints:!1}},description:"SCMR Dynamic Levels\u2122",shortDescription:"SCMR Dynamic Levels\u2122",is_price_study:!0,inputs:[{defval:"#0>#0@1&>#1@1&>#3||#0>#0@1&>#2@2&>#3;#0<#0@1&<#1@1&<#3||#1<#1@1&<#2@2&<#4||#0<#0@1&<#1@2&<#4;#0?#1:na;t:<in_0>~t:tickerid~sym($4,$3,$3,0)|$0(high,low,close,open)~$6|sym($4,$3,$3,0)|close~lowest($10,2)~offset($11,1)~$1(high,low,close,open,$12)~$13|sym($4,$3,$3,0)|$0(high,low,close,open)~$7~$2($18,low)~$19|$20~sym($4,$3,$3,0)|close~lowest($24,2)~offset($25,1)~$1(high,low,close,open,$26)~$14~$2($28,high)~$29|$30~$32!$22",
|
|
id:"text",name:"ILScript",type:"text",isHidden:!0},{id:"in_0",name:"Lookback. IMPORTANT: Use period *at least* ~5x your chart timeframe. Ex: on 1min chart - select '5' or '15'. On daily chart -> select 'W' or '1M', etc.",defval:"1M",type:"text",isFake:!0},{id:"in_1",name:"width",defval:3,type:"integer",min:1,max:8,isFake:!0}],id:"Script$SPYDERCR_SCMR_Dynamic_Levels@tv-scripting-1",scriptIdPart:"SPYDERCR_SCMR_Dynamic_Levels",TVScriptMetaInfoExprs:{tree:"width=##input(defval=3,##id='in_1')\n##root(root_metainfo,rm_0,width)\n##root(root_metainfo,rm_1,width)\n",
|
|
patchMap:{"defaults.styles.plot_0.linewidth":"rm_1","defaults.styles.plot_1.linewidth":"rm_1"}}},{_metainfoVersion:27,isTVScript:!0,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:7,plottype:1,trackPrice:!1,transparency:40,visible:!0,color:"#FF9D9D"},plot_1:{linestyle:0,linewidth:7,plottype:1,trackPrice:!1,transparency:40,visible:!0,color:"#009933"},plot_2:{linestyle:0,linewidth:7,plottype:1,trackPrice:!1,transparency:58,visible:!0,color:"#FF5050"},plot_3:{linestyle:0,
|
|
linewidth:7,plottype:1,trackPrice:!1,transparency:58,visible:!0,color:"#00ff00"},plot_4:{linestyle:0,linewidth:7,plottype:1,trackPrice:!1,transparency:40,visible:!0,color:"#800000"},plot_5:{linestyle:0,linewidth:7,plottype:1,trackPrice:!1,transparency:40,visible:!0,color:"#005C00"},plot_6:{visible:!0,location:"Bottom",transparency:35,"char":"\u2593",color:"#0000FF"},plot_7:{visible:!0,location:"Top",transparency:35,"char":"\u2593",color:"#0000FF"},plot_8:{linestyle:0,linewidth:1,plottype:6,trackPrice:!1,
|
|
transparency:65,visible:!0,color:"#0000FF"},plot_9:{linestyle:0,linewidth:1,plottype:6,trackPrice:!1,transparency:65,visible:!0,color:"#0000FF"}},precision:2,bands:[{color:"#FFFFFF",linestyle:1,linewidth:1,visible:!0,value:0}],inputs:{text:"(#0-#1)/#2*-100;#0<10?#1:na;#0>90?#1:na;#0@1<10&�>10&<90?#2:na;#0@1>90&�<90?#1:na;i:<in_0>~high~highest($6,13)~$0($7,close,$7)~highest($6,125)~$0($9,close,$9)~low~lowest($11,13)~$0($12,close,$12)~lowest($11,125)~$0($14,close,$14)~percentrank($8,$5)~percentrank($13,$5)~$10!$15!$8!$13!$1($16,$8)!$2($17,$13)!$3($16,$17,$13)!$4($17,$8)!lowest($8,$5)~highest($13,$5)~$26!$27",
|
|
in_0:65}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"},{id:"plot_3",type:"line"},{id:"plot_4",type:"line"},{id:"plot_5",type:"line"},{id:"plot_6",type:"chars"},{id:"plot_7",type:"chars"},{id:"plot_8",type:"line"},{id:"plot_9",type:"line"}],styles:{plot_0:{title:"Percent Advance Fast",histogramBase:0,joinPoints:!1},plot_1:{title:"Percent Advance Slow",histogramBase:0,joinPoints:!1},plot_2:{title:"Percent Drawdown Fast",histogramBase:0,joinPoints:!1},plot_3:{title:"Percent Drawdown Low",
|
|
histogramBase:0,joinPoints:!1},plot_4:{title:"Lower End of Price Range",histogramBase:0,joinPoints:!1},plot_5:{title:"Upper End of Price Range",histogramBase:0,joinPoints:!1},plot_6:{title:"Lower End Range Marker"},plot_7:{title:"Upper End Range Marker"},plot_8:{title:"High Band",histogramBase:0,joinPoints:!1},plot_9:{title:"Low Band",histogramBase:0,joinPoints:!1}},description:"SCMR Momentum Peaks\u2122",shortDescription:"SCMR Momentum Peaks\u2122",is_price_study:!1,bands:[{id:"hline_0",name:"Zero Line"}],
|
|
inputs:[{defval:"(#0-#1)/#2*-100;#0<10?#1:na;#0>90?#1:na;#0@1<10&�>10&<90?#2:na;#0@1>90&�<90?#1:na;i:<in_0>~high~highest($6,13)~$0($7,close,$7)~highest($6,125)~$0($9,close,$9)~low~lowest($11,13)~$0($12,close,$12)~lowest($11,125)~$0($14,close,$14)~percentrank($8,$5)~percentrank($13,$5)~$10!$15!$8!$13!$1($16,$8)!$2($17,$13)!$3($16,$17,$13)!$4($17,$8)!lowest($8,$5)~highest($13,$5)~$26!$27",id:"text",name:"ILScript",type:"text",isHidden:!0},{id:"in_0",name:"Length to Determine Range",defval:65,
|
|
type:"integer",min:5,max:2E3,isFake:!0}],id:"Script$SPYDERCR_SCMR_Momentum_Peaks@tv-scripting-1",scriptIdPart:"SPYDERCR_SCMR_Momentum_Peaks"},{_metainfoVersion:27,isTVScript:!0,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{visible:!0,location:"BelowBar",transparency:35,"char":"\u25b2",color:"#008080"},plot_1:{visible:!0,location:"AboveBar",transparency:35,"char":"\u25bc",color:"#CC0099"}},precision:0,inputs:{text:"#0>#0@1&>#1@1&>#3||#0>#0@1&>#2@2&>#3;#0<#0@1&<#1@1&<#3||#1<#1@1&<#2@2&<#4||#0<#0@1&<#1@2&<#4;$0(high,low,close,open)~close~lowest($3,2)~offset($4,1)~$1(high,low,close,open,$5)~$2!$6"}},
|
|
plots:[{id:"plot_0",type:"chars"},{id:"plot_1",type:"chars"}],styles:{plot_0:{title:"B2B Up\u2122"},plot_1:{title:"B2B Down\u2122"}},description:"SCMR B2B\u2122",shortDescription:"SCMR B2B\u2122",is_price_study:!0,inputs:[{defval:"#0>#0@1&>#1@1&>#3||#0>#0@1&>#2@2&>#3;#0<#0@1&<#1@1&<#3||#1<#1@1&<#2@2&<#4||#0<#0@1&<#1@2&<#4;$0(high,low,close,open)~close~lowest($3,2)~offset($4,1)~$1(high,low,close,open,$5)~$2!$6",id:"text",name:"ILScript",type:"text",isHidden:!0}],id:"Script$SPYDERCR_SCMR_B2B@tv-scripting-1",
|
|
scriptIdPart:"SPYDERCR_SCMR_B2B"}];Q62=function(a){this._graphics=Q62.emptyGraphics();assert(!!a,"Study metaInfo is absent!");this._metaInfo=a};Q62.emptyGraphics=function(){return{indexes:[]}};Q62.prototype.isEmpty=function(){var a=1<Object.keys(this._graphics).length;return 0==this._graphics.indexes.length&&!a};Q62.prototype.graphics=function(){return this._graphics};
|
|
Q62.prototype.setGraphics=function(a){this._graphics=a;this._postProcessGraphicsData()};Q62.prototype.process=function(a){""!==a.d&&(TradingView.logDebug("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)))};
|
|
Q62.prototype.replaceIndexes=function(a){""!==a.d&&(assert(!!a.d.indexes_replace),this._graphics.indexes=a.indexes,TradingView.logDebug("timescale has been replaced with a new one (replaceIndexes)"))};
|
|
Q62.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=Q62.emptyGraphics(),TradingView.logDebug("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=Q62._findGraphicsObjIndexById(e.data,
|
|
c.id);0<=f?(e.data.splice(f,1),TradingView.logDebug("erased one the graphics obj with id="+c.id)):TradingView.logDebug("cannot erase obj with id="+c.id+" because it doesn't exist")}else Error("Unknown graphics command "+c.action)}}};Q62._findGraphicsObjIndexById=function(a,b){for(var c=0;c<a.length;++c)if(a[c].id===b)return c;return-1};
|
|
Q62.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.logDebug("created "+e.data.length+" graphics objects")}}"nochange"===b?TradingView.logDebug("timescale hasn't changed"):(assert(isArray(b)),this._graphics.indexes=b,TradingView.logDebug("timescale has been replaced with a new one"));this._postProcessGraphicsData()}};
|
|
Q62.prototype._postProcessGraphicsData=function(){if(this._graphics)for(var a in this._graphics.hhists){var b=this._graphics.hhists[a];Q62._sortHHistItemsByPrice(b.data);b.dataObj=Q62._splitHHistItemsBySession(b.data,this._graphics.indexes)}};Q62._sortHHistItemsByPrice=function(a){a.sort(function(a,c){return a.priceLow-c.priceLow})};
|
|
Q62._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};Q64=function(a){this._studyId=a;this._maxFromVers=this._maxToVers="0";this._migrs=[]};Q64.prototype.addMigration=function(a,b,c){Q0.isGreater(a,this._maxFromVers)&&(this._maxFromVers=a);Q0.isGreater(b,this._maxToVers)&&(this._maxToVers=b);this._migrs.push({fromVers:a,toVers:b,rules:c})};
|
|
Q64.prototype.updateInputs=function(a,b){if(!b)return b;var c=TradingView.clone(b);TradingView.logDebug("Applying migrations to study: "+this._studyId+" from vers: "+a+" to vers: "+this._maxToVers);for(var d=a;Q0.isLess(d,this._maxToVers);){var e=this._findMigration(d),c=this._applyMigration(c,e);if(!Q0.isLess(d,e.toVers))throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");
|
|
d=e.toVers;TradingView.logDebug("Applied migration rule to study: "+this._studyId+" from vers: "+e.fromVers+" to vers: "+e.toVers)}return c};
|
|
Q64.prototype._findMigration=function(a){for(var b=-1,c=this._maxFromVers,d=0;d<this._migrs.length;d++){var e=this._migrs[d];!Q0.isLess(e.fromVers,a)&&Q0.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]};
|
|
Q64.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};Q64.prototype._getApplyRuleFun=function(a){if("inputRemoved"==a)return Q64._applyInputRemovedRule;if("inputChangedType"==a)return Q64._applyInputChangedTypeRule;throw Error("Unknown migration rule type: "+mr.type);};
|
|
Q64._applyInputRemovedRule=function(a,b){if(!(b.inputId in a))return a;var c=Q0.findInputKeyById(a,b.inputId);if(c){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}};
|
|
Q64._applyInputChangedTypeRule=function(a,b){var c=Q0.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};Q0=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 q=m in this._migrations?this._migrations[m]:new Q64(m);q.addMigration(g,h,l.rules);this._migrations[m]=q}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}]};
|
|
Q0.prototype.updateMetaInfo=function(a){if(!a)return a;var b=null;if(a.isTVScript&&a.TVScriptSourceCode){var c=this._studiesMetainfo.isEmpty()?"1":Q57.tvScriptingPkgVersion(this._studiesMetainfo),d=a.scriptIdPart||TVScript.MetainfoGenerator.createScriptIdPart();try{b=Q57.translateScript(a.TVScriptSourceCode,null,d,c),TradingView.merge(b,StudyMetaInfo.parseIdString(b.id))}catch(e){console.warn("Could not compile Pine script (skipping): "+
|
|
a.description)}}else for(c=this._studiesMetainfo,d=0;d<c.size();d++)if(c.item(d).id===a.id){b=c.item(d);break}b&&(b=StudyMetaInfo.replaceWithFullStudyMetaInfo(this._studiesMetainfo,b));return TradingView.clone(b)};
|
|
Q0.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={},Q0.mergeInputs(d,
|
|
c.inputs),Q0.mergeInputs(d,c.defaults.inputs),Q0.mergeInputs(d,a.inputs),a.inputs=d,d=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};
|
|
Q0.prototype.patchPointsBasedStudyState=function(a){Q0._fixInputsMaxValue(a.state,a.metaInfo);"LineToolRegressionTrend"===a.type&&(a=TradingView.LineToolRegressionTrend.patchSourceState(a));return a};Q0.prototype.patchPointsBasedStudyData=function(a,b){if(!a||!b)return b;var c=TradingView.clone(b);"VbPFixed@tv-volumebyprice"===a.id&&a.version&&4>=a.version&&Q0._patchOldVolumeProfiles(0,c);return c};
|
|
Q0.prototype.patchStudyData=function(a,b,c,d){b=TradingView.clone(b);c=TradingView.clone(c);d=TradingView.clone(d);"VbPVisible@tv-volumebyprice"===a.id&&a.version&&4>=a.version&&Q0._patchOldVolumeProfiles(0,b.graphics);"VbPSessions@tv-volumebyprice"===a.id&&a.version&&4>=a.version&&Q0._patchOldVolumeProfiles(0,b.graphics);var e=StudyMetaInfo.versionOf(a);if(a.isTVScript&&a.TVScriptSourceCode&&12<=e&&26>=e)for(a=b.columns,b.columns=
|
|
[],e=0;e<a.length;++e){var f=TVScript.MetainfoGenerator.generatePlotId(e);b.columns.push(f)}return{data:b,nsData:c,indexes:d}};Q0._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};
|
|
Q0._fixInputsOrder=function(a,b){for(var c=StudyMetaInfo.getOrderedInputIds(b),d=Q0.splitInputs(a.inputs),e=d.arr,d=TradingView.merge({},d.obj),f=0;f<c.length;++f){var g=Q0.findInputKeyById(e,c[f]);void 0!=g&&(d[f]=e[g])}a.inputs=d};
|
|
Q0._fixInputsMaxValue=function(a,b){if(b.inputs)for(var c=0;c<b.inputs.length;c++)b.inputs[c].max&&253370764800<b.inputs[c].max&&(b.inputs[c].max=253370764800);if(a&&a.inputs){var c=Q0.splitInputs(a.inputs),d=c.arr;for(key in d){var e=d[key];e.max&&253370764800<e.max&&(e.max=253370764800)}a.inputs=TradingView.merge(c.obj,c.arr)}};
|
|
Q0.prototype.patchPropsStateAndMetaInfo=function(a,b){Q0._fixInputsOrder(a,b);Q0._fixInputsMaxValue(a,b);b.isTVScript&&(b.scriptIdPart=b.scriptIdPart||TVScript.MetainfoGenerator.createScriptIdPart());"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 c=a.color;delete a.color;a.levelsStyle={colors:{P:c,"S1/R1":c,"S2/R2":c,"S3/R3":c,"S4/R4":c,"S5/R5":c}}}"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&&!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 c=new 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:{}}),d=new 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:{}}),
|
|
e=new 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:{}}),f=new 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":result.metaInfo=c;break;case "simple":result.metaInfo=d;break;case "weighted":result.metaInfo=f;break;case "volume weighted":result.metaInfo=e}a.styles[b.plots[0].id]=a.styles.MovAvg;delete a.styles.MovAvg;delete a.inputs.type}return{propsState:a,metaInfo:b}};
|
|
Q0.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};Q0.isLess=function(a,b){return 0>Q0.compareStudyVersions(a,b)};
|
|
Q0.isLessOrEqual=function(a,b){return 0>=Q0.compareStudyVersions(a,b)};Q0.isEqual=function(a,b){return 0==Q0.compareStudyVersions(a,b)};Q0.isGreater=function(a,b){return 0<Q0.compareStudyVersions(a,b)};Q0.isGreaterOrEqual=function(a,b){return 0<=Q0.compareStudyVersions(a,b)};
|
|
Q0.isVersionTesting=function(a){if(!a)return!1;a=a.toString();return/\d+.\d+/.exec(a)==a};Q0.isVersionHead=function(a){if(!a)return!1;a=a.toString();return/\d+/.exec(a)==a};Q0.mergeInputs=function(a,b){Q0.mergeInputsArrPart(a,b);Q0.mergeInputsObjPart(a,b)};
|
|
Q0.mergeInputsArrPart=function(a,b){var c=Q0.splitInputs(b),d;for(d in c.arr){var e=Q0.findInputKeyById(a,c.arr[d].id);e?TradingView.merge(a[e],c.arr[d]):Q0.appendInputInfoToArr(a,c.arr[d])}};Q0.mergeInputsObjPart=function(a,b){var c=Q0.splitInputs(b);TradingView.merge(a,c.obj)};
|
|
Q0.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};Q0.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}};Q0.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};
|
|
Q0.getInputKeyById=function(a,b){var c=Q0.findInputKeyById(a,b);if(!c)throw Error("Cannot find input with id: "+b);return c};Q48=function(a,b,c,d,e){TradingView.Study.call(this,a,b,c,d);this._paneView=e};inherit(Q48,TradingView.Study);
|
|
Q48.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.D99.paneForSource(this);this.D99.recalculatePane(a,!0);this.D99.updateSource(this);break;default:return TradingView.Study.prototype.onData.call(this,a)}};
|
|
Q48.prototype.updateAllViews=function(){this._paneView.update();this._dataWindowView.update();this._statusView.update()};Q48.prototype.paneViews=function(a){a=new List;a.append(this._paneView);return a};Q48.prototype.state=function(a){var b=TradingView.Study.prototype.state.call(this,a);a&&(b.nonSeriesData=this._nonseriesdata,b.indexes=this._indexes);return b};
|
|
Q48.prototype.restoreData=function(a,b,c){TradingView.Study.prototype.restoreData.call(this,a);this._nonseriesdata=b;this._indexes=c};Q48.prototype.clearData=function(){this._indexes=this._nonseriesdata=null};function LocationToYMixin(){}
|
|
LocationToYMixin.prototype._locationToY=function(a,b,c){c||(c=0);var d=[],e=this.Z0.priceScale(),f;switch(a){case CanvasEx.MARKLOC_ABOVEBAR:f=HIGH_PLOT;break;case CanvasEx.MARKLOC_BELOWBAR:f=LOW_PLOT}var g=this.Z0.firstValue();1<=c&&(c-=1);for(var h=-c;h<=c;h++){var k=this.Z0.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}};function D32(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])}
|
|
D32.prototype.items=function(){return this.m_items};D32.prototype.update=function(){this._invalidated=!0};
|
|
D32.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(),SEARCH_NEAREST_RIGHT),c=this.m_series.nearestIndex(a.lastBar(),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.Study.PLOT_LINE,TradingView.Study.PLOT_AREA,TradingView.Study.PLOT_CIRCLES,TradingView.Study.PLOT_CROSS].indexOf(d),f=this.m_study.data(),d=this.m_study.firstValue();if(e&&0<f._length()){for(var g=function(a){return isNaN(a)||void 0===a||null===a},h=f._bsearch(b);0<=h&&h<f._length()&&g(f._valueAt(h)[this._plotIndex+1]);)h-=1;b=0<=h&&h<f._length()?f._indexAt(h):b;for(h=f._bsearch(c);0<=h&&h<f._length()&&g(f._valueAt(h)[this._plotIndex+1]);)h+=1;c=0<=h&&h<f._length()?f._indexAt(h):
|
|
c}for(var h=f.range(b,c),f=this.m_study.priceScale(),k=f.properties().percentage.value(),l=this._getTranspValue(),g=h._start;g<h._end;++g){var m=h._indexAt(g),m=m+a,m=Math.floor(m),q=h._valueAt(g),n=q[this._plotIndex+1],n=null!==n&&void 0!==n?n:NaN;k&&!isNaN(n)&&(n=100*(n-d)/d);e&&isNaN(n)||(m=new MathEx.Point(m,n),n=void 0!==q[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&n&&(n=q[this._colorer+1],m.style={},void 0!=n?(q=this._paletterProps.colors[n].color.value(),
|
|
m.style.color=generateColor(q,l)):(q=this.m_study.properties().styles[this._plotName].color.value(),m.style.color=generateColor(q,100)),q=void 0!=n?this._paletterProps.colors[n].width.value():this.m_study.properties().styles[this._plotName].linewidth.value(),n=void 0!=n?this._paletterProps.colors[n].style.value():this.m_study.properties().styles[this._plotName].linestyle.value(),m.style.width=q,m.style.style=n),this.m_items.append(m))}f.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=(new SelectionIndexes).calc(b,c),this._selectionData={points:new List},this._selectionData.hittestResult=HitTestResult.REGULAR,g=0;g<b.size();g++)m=b.item(g),q=this.m_study.data().valueAt(m),m+=a,void 0!==q&&(n=q[this._plotIndex+1],f.properties().percentage.value()&&
|
|
(n=100*(n-d)/d),c=this.m_model.timeScale().indexToCoordinate(Math.floor(m)),e=this.m_study.priceScale().priceToCoordinate(n),this._selectionData.points.append(new MathEx.Point(c,e)))}}};
|
|
D32.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.Study.PLOT_COLUMNS)return a;0<=[TradingView.Study.PLOT_AREA,TradingView.Study.PLOT_AREA_WITH_BREAKS,TradingView.Study.PLOT_COLUMNS].indexOf(c)&&b.transparency&&(a=b.transparency.value(),
|
|
a=isNumber(a)?a:50);return a};
|
|
D32.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={},c=this._getTranspValue(),d=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.lineColor=generateColor(a.color.value(),c);b.lineStyle=a.linestyle.value();
|
|
b.lineWidth=a.linewidth.value();this._colorer&&(d=this._paletterProps.colors[0].color.value(),b.lineWidth=this._paletterProps.colors[0].width.value(),b.lineColor=generateColor(this._paletterProps.colors[0].color.value(),c));b.lineWidth=isNumber(b.lineWidth)?b.lineWidth:1;b.color2=generateColor(d,c);var d=new RGBColor(d),e=TradingView.rgbToHsl(d.r,d.g,d.b),f=e[0]+0.05;e[0]=f-Math.floor(f);e=TradingView.hslToRgb(e[0],e[1],e[2]);d.r=e[0];d.g=e[1];d.b=e[2];d=d.toHex();b.color1=generateColor(d,c);b.bottom=
|
|
b.histogramBase;this._colorer||(b.simpleMode=!0);c=new CompositeRenderer;d=a.joinPoints?a.joinPoints.value():!1;switch(a.plottype.value()){case TradingView.Study.PLOT_LINE:case TradingView.Study.PLOT_LINE_WITH_BREAKS:c.append(new D67(b));break;case TradingView.Study.PLOT_AREA:case TradingView.Study.PLOT_AREA_WITH_BREAKS:c.append(new D52(b));break;case TradingView.Study.PLOT_HISTOGRAM:c.append(new D65(b));break;case TradingView.Study.PLOT_COLUMNS:c.append(new D59(b));
|
|
break;case TradingView.Study.PLOT_CROSS:c.append(new D60(b));d&&(a=TradingView.merge({},b),a.lineWidth=1,a.forceLineWidth=!0,c.append(new D67(a)));break;case TradingView.Study.PLOT_CIRCLES:c.append(new D57(b));d&&(a=TradingView.merge({},b),a.lineWidth=1,a.ignorePaletteLineWidth=!0,c.append(new D67(a)));break;default:c.append(new D67(b))}this.m_study===this.m_model.selectedSource()&&c.append(new SelectionRenderer(this._selectionData));
|
|
return c}};function D29(a,b,c,d){this.Z0=a;this._series=b;this.D99=c;this._plotName=d;this._items=new List;this._invalidated=!0;a=this.Z0.metaInfo().plots;for(b=0;b<a.length;b++)a[b].id===this._plotName&&(this._plotIndex=b,assert(this.Z0.isBgColorerPlot(b),"Plot '"+this._plotName+"' is not a background colorer!"))}D29.prototype.items=function(){return this._items};D29.prototype.update=function(){this._invalidated=!0};
|
|
D29.prototype._scalesReady=function(){var a=this.D99.timeScale(),b=this.Z0.priceScale();return a&&b&&!a.isEmpty()&&!b.isEmpty()};
|
|
D29.prototype._updateImpl=function(){this._items.clear();assert(this._scalesReady(),"Scales must be ready!");var a=this.D99.timeScale().visibleBars().clone();if(!a.isEmpty()){var b=this.Z0.metaInfo().plots[this._plotIndex].palette,b=this.Z0.properties().palettes[b].colors,c=this.Z0.properties().styles[this._plotName].transparency.value(),d=this._series.nearestIndex(a.firstBar(),SEARCH_NEAREST_RIGHT),e=this._series.nearestIndex(a.lastBar(),SEARCH_NEAREST_LEFT),a=
|
|
this.Z0.offset(this._plotName);0<a?(d-=a,e+=a):(d+=a,e-=a);d=this.Z0.data().range(d,e);for(e=d._start;e<d._end;++e){var f=d._indexAt(e),f=f+a,g=d._valueAt(e)[this._plotIndex+1],f=new MathEx.Point(Math.floor(f)-0.5),h=isNumber(c)?c:50,h=Math.min(h,100),h=Math.max(h,0);f.color=void 0==g?null:generateColor(b[g].color.value(),h);this._items.append(f)}this.D99.timeScale().indexesToCoordinates(this._items)}};
|
|
D29.prototype.renderer=function(){if(this.Z0.properties().styles[this._plotName].visible&&this.Z0.properties().styles[this._plotName].visible.value()&&this._scalesReady()){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var a={items:this._items,y:0,h:this.Z0.priceScale().height(),w:Math.ceil(this.D99.timeScale().barSpacing())},b=new CompositeRenderer;b.append(new D54(a));return b}};
|
|
function D35(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._paletterProps=this._palette=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])}D35.prototype.items=function(){return this.m_items};D35.prototype.update=function(){this.m_invalidated=!0};D35.prototype._scalesReady=function(){var a=this.m_model.timeScale(),b=this.m_study.priceScale();return a&&b&&!a.isEmpty()&&!b.isEmpty()};
|
|
D35.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(),SEARCH_NEAREST_RIGHT),d=this.m_series.nearestIndex(a.lastBar(),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();b=this._getTranspValue();c=(new SelectionIndexes).calc(c,d).toArray();if(d=this.m_study===this.m_model.selectedSource())this.m_selectionData={points:new List,hittestResult:HitTestResult.REGULAR,vertOffset:0};var h=this.m_series.properties().style.value();if(h=h===TradingView.Series.STYLE_LINE?"lineStyle":h===TradingView.Series.STYLE_AREA?"areaStyle":null)var k=h=this.m_series.properties()[h].priceSource.value();else h="high",k="low";for(var l=e._start;l<e._end;++l){var m=e._indexAt(l),
|
|
q=Math.floor(m+a),n=function(a){try{var b=this.m_series[a||"close"](q)}catch(c){b=null}return b}.bind(this),t=e._valueAt(l),u=t[this.m_plotIndex+1];if(null!==u&&void 0!==u){g&&(u=100*(u-f)/f);var z=this.m_study.metaInfo().plots[this.m_plotIndex].type,s=this.m_study.properties().styles[this.m_plotName].location;if(z=(z=z==TradingView.Study.PLOT_TYPE_ARROWS)||s&&0<=[CanvasEx.MARKLOC_ABOVEBAR,CanvasEx.MARKLOC_BELOWBAR].indexOf(s.value())){if(s=n(h),n=n(k),void 0==s||void 0==n)continue}else n=s=u;n=this._createItem(q,
|
|
u,s,n);void 0!=n&&(u=void 0!==t[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&u&&(u=t[this._colorer+1],n.style={},void 0!=u?(u=this._paletterProps.colors[u].color.value(),n.style.color=generateColor(u,b)):(u=this.m_study.properties().styles[this.m_plotName].color.value(),n.style.color=generateColor(u,100))),this.m_model.timeScale().indexToCoordinate(Math.floor(q)),this.m_study.priceScale().priceToCoordinate(t),d&&-1!==$.inArray(m,c)&&this.m_selectionData.points.append(n),
|
|
this.m_items.append(n))}}this._convertItemsToCoordinates()}}};D35.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};
|
|
D35.prototype._createItem=function(a,b,c,d){var e=this.m_study.properties().styles[this.m_plotName].location.value(),f=this.m_study.priceScale(),g=f.coordinateToPrice(f.height()*f.topMargin()),f=f.coordinateToPrice(f.height()*(1-f.bottomMargin()));if(!b&&e!=CanvasEx.MARKLOC_ABSOLUTE)return null;switch(e){case CanvasEx.MARKLOC_ABOVEBAR:b=c;break;case CanvasEx.MARKLOC_BELOWBAR:b=d;break;case CanvasEx.MARKLOC_TOP:b=g;break;case CanvasEx.MARKLOC_BOTTOM:b=f;break;case CanvasEx.MARKLOC_ABSOLUTE:break;
|
|
default:throw Error("Bad value: "+e);}return new MathEx.Point(a,b)};D35.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})};
|
|
D35.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;default:c=0}return c};D35.prototype._calculateShapeHeight=function(a){return Math.round(a/2)};
|
|
D35.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=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 CompositeRenderer;d.append(new window[c.paneRendererClass](b));this.m_study===this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=a,d.append(new SelectionRenderer(this.m_selectionData)));return d}};
|
|
function D34(a,b,c,d){D35.call(this,a,b,c,d)}inherit(D34,D35);D34.prototype._calculateShapeHeight=function(a){return Math.round(a)};
|
|
D34.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_study.priceScale();this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1);var b={},c=0;this.m_study.properties().transparency&&(c=this.m_study.properties().transparency.value(),c=isNumber(c)?c:50);var d=this.m_study.properties().styles[this.m_plotName];
|
|
d.transparency&&(c=d.transparency.value(),c=isNumber(c)?c:50);a=a.barSpacing();a=this._calculateShapeHeight(a);d=this.m_study.properties().styles[this.m_plotName].location.value();d=this._calculateVerticalOffset(d,a);b.items=this.m_items;b["char"]=this.m_study.properties().styles[this.m_plotName]["char"].value();b.height=a;b.vertOffset=d;b.color=generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),c);c=new CompositeRenderer;c.append(new D72(b));this.m_study===
|
|
this.m_model.selectedSource()&&(this.m_selectionData.vertOffset=d,c.append(new SelectionRenderer(this.m_selectionData)));return c}};function D33(a,b,c,d){D35.call(this,a,b,c,d);this._maxAbsValue=0}inherit(D33,D35);
|
|
D33.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=0;this.m_study.properties().transparency&&(b=this.m_study.properties().transparency.value(),b=isNumber(b)?b:50);var c=this.m_study.properties().styles[this.m_plotName];c.transparency&&(b=c.transparency.value(),b=isNumber(b)?
|
|
b:50);c=this.m_model.timeScale().barSpacing();a.items=this.m_items;a.barSpacing=c;a.colorup=generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),b);a.colordown=generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),b);a.colorBorder=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 CompositeRenderer;b.append(new D53(a));
|
|
this.m_study===this.m_model.selectedSource()&&(a=this.m_selectionData,a.barSpacing=c,b.append(new SelectionRendererArrowsUpDown(a)));return b}};D33.prototype._createItem=function(a,b,c,d){if(0!==b){Math.abs(b)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(b));var e=0<b;return new PaneRendererArrowsUpDownItem(a,e?d:c,b,e)}};
|
|
D33.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}};function D50(a,b,c){this.Z0=a;this.D99=b;this._plotIndex=c;this._text="";this._coordinate=0;this._background="black";this._color="white";this._textHeight=14;this._invalidated=!0}inherit(D50,PriceAxisView);D50.prototype.update=function(){this._invalidated=!0};
|
|
D50.prototype._updateImpl=function(){this._visible=!1;this._text="";var a=this.Z0.lastValueData(this._plotIndex);a&&(this._visible=!0,this._text=a.text,this._coordinate=a.coordinate,this._background=a.color,this._textHeight=this.Z0.priceScale().m_markBuilder.fontHeight())};
|
|
D50.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 PriceAxisViewRenderer(a)};D50.prototype.text=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.text.call(this)};function StudyDataWindowView(a,b){DataWindowView.call(this);this.Z0=a;this.D99=b;var c=a.metaInfo().plots;if(c){for(var d=0;d<c.length;++d)if(!(this.Z0.isSelfColorerPlot(d)||this.Z0.isBarColorerPlot(d)||this.Z0.isBgColorerPlot(d)||this.Z0.isDataOffsetPlot(d))){var e=c[d].id,f;if("Compare@tv-basicstudies"===this.Z0.metaInfo().id)f=new DataWindowItem(this.Z0.inputsForGUI()[1],"");else{f=this.Z0.title();try{f=this.Z0.properties().styles[e].title.value()}catch(g){}f=
|
|
new DataWindowItem(f,"")}f.plotId=e;f.plotIndex=d;this._items.append(f)}this.update();this._invalidated=!0}}inherit(StudyDataWindowView,DataWindowView);StudyDataWindowView.prototype.update=function(){this._invalidated=!0};
|
|
StudyDataWindowView.prototype._updateImpl=function(){this._header=this.Z0.title(!0);this._title=this.Z0.title();for(var a=$.t("n/a"),b=0;b<this._items.size();++b)this._items.item(b).setValue(a);if(!this.D99.timeScale().isEmpty()){var c=this.Z0.metaInfo().plots,d=null,a={};if(c)for(b=0;b<c.length;b++)this.Z0.isSelfColorerPlot(b)&&(a[c[b].target]={index:b},a[c[b].target].palette=this.Z0.metaInfo().palettes[c[b].palette],a[c[b].target].paletterProps=this.Z0.properties().palettes[c[b].palette]);
|
|
for(var c=this.D99.crossHairSource().index,e=this.Z0.formatter(),b=0;b<this._items.size();++b){var d=this._items.item(b).plotId,f=this._items.item(b).plotIndex,g=this.Z0.offset(d),g=this.Z0.nearestIndex(c-g,SEARCH_NEAREST_LEFT);void 0!==g&&(g=this.Z0.data().valueAt(g)||this.Z0.data().last())&&(f=g[f+1],isNumber(f)&&(this._items.item(b).setValue(e.format(f)),f=this.Z0.properties().styles[d].color.value(),a[d]&&g.length>a[d].index+1?(g=g[a[d].index+1],void 0!=g?(d=a[d].paletterProps,
|
|
this._items.item(b).setColor(d.colors[g].color.value())):this._items.item(b).setColor(f)):this._items.item(b).setColor(f)))}}};StudyDataWindowView.prototype.items=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._items};function DataVendorStudyDataWindowView(a,b){StudyDataWindowView.call(this,a,b)}inherit(DataVendorStudyDataWindowView,StudyDataWindowView);
|
|
DataVendorStudyDataWindowView.prototype.additional=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._additional};DataVendorStudyDataWindowView.prototype._updateImpl=function(){var a=TradingView.getDataVendorString(this.Z0.symbolInfo());this._additional=a?"(Data Provided by "+a+")":void 0;return StudyDataWindowView.prototype._updateImpl.call(this)};function StudyStatusView(a,b){StatusView.call(this,b);this.Z0=a}inherit(StudyStatusView,StatusView);StudyStatusView.prototype.color=function(){return this.Z0._failed?"#ff0000":StatusView.prototype.color.call(this)};StudyStatusView.prototype.update=function(){this._text=this.Z0._failed?this.Z0.title(!0)+": "+this.Z0.status():this.Z0.title(!0)+" "+this.Z0.status()};function W89(a,b){this.D98=a;this.D99=b;this._points=new List;this._floatPoints=new List}W89.prototype.addAnchors=function(a){if(this.isAnchorsRequired()){var b=this._points.clone();this.D99.lineBeingCreated()==this.D98&&b.removeAt(b.size()-1);a.append(this.createLineAnchor({points:b}))}};
|
|
W89.prototype.update=function(){var a=this.D98.priceScale(),b=this.D99.timeScale();if(a&&!a.isEmpty()&&!b.isEmpty())for(this._points=new List,this._floatPoints=new List,a=0;a<this.D98.points().size();a++){var b=this.D98.points().item(a),c=this.D98.pointToScreenPoint(b);if(!c)break;b=c[0];b.data=a;c=c[1];c.data=a;this._floatPoints.append(b);this._points.append(c)}};
|
|
W89.prototype.currentPoint=function(){var a=this.D99.crossHairSource();return new MathEx.Point(a.x,a.y)};W89.prototype.anchorColor=function(){return this.D98.isBeingEdited()?"#D61AD3":this.D99.isDark()?"#FFFFFF":"#606060"};W89.prototype.isHoveredSource=function(){return this.D98===this.D99.hoveredSource()};W89.prototype.isSelectedSource=function(){return this.D98===this.D99.selectedSource()};
|
|
W89.prototype.isAnchorsRequired=function(){return this.isHoveredSource()||this.isSelectedSource()};
|
|
W89.prototype.createLineAnchor=function(a){return new LineAnchor($.extend({color:this.anchorColor(),backgroundColor:this.D99.backgroundColor(),currentPoint:this.currentPoint(),linePointBeingEdited:this.D99.linePointBeingEdited(),hittestResult: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.D37(a,this,"compare");TradingView.Study.call(this,a,b,c,d);var e=this;this.Z1.minTick.listeners().subscribe(null,function(){e._createFormatter()});this.properties().minTick.listeners().subscribe(null,function(){e.D99.Z19(new Q22(Q22.FULL_UPDATE))});this.Z1.merge({skipHistogramBaseOnAutoScale:!0})};
|
|
inherit(TradingView.study_Compare,TradingView.Study);TradingView.study_Compare.prototype.createViews=function(){this._dataWindowView||(this._dataWindowView=new DataVendorStudyDataWindowView(this,this.D99));TradingView.Study.prototype.createViews.call(this);this._paneViews.append(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 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 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.Z1.inputs.symbol.value();return a?this._resolvedSymbols[a]:null};function AreaBackgroundRenderer(a){this._data=a}AreaBackgroundRenderer.prototype.hitTest=function(a){selectionTolerance(this.lineWidth);for(var b=1;b<this._data.points1.length;++b)if(currY1=this._data.points1[b],currY2=this._data.points2[b],x=this._data.timePoints[b],x==a.x&&(a.y>=currY1&&a.y<=currY2||a.y<=currY1&&a.y>=currY2))return new HitTestResult(HitTestResult.REGULAR);return null};
|
|
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=paneRendererCoordinateIsValid,g=isNumber(this._data.transparency)?this._data.transparency:50,g=Math.min(g,100),g=Math.max(g,0),g=generateColor(this._data.backcolor,g),h,k,l,m,q,n,t=0;t<this._data.timePoints.length;t++)if(k=b[t],l=c[t],m=d[t],q=c[t+1],n=d[t+1],f(l)&&f(l)&&(h||(h={points1:[],
|
|
points2:[],timePoints:[]}),h.points1.push(l),h.points2.push(m),h.timePoints.push(k)),h&&(!f(q)||!f(n))){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]);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.W52=function(a){this.D98=a;this._points1=[];this._points2=[];this._timePoints=[];this._getBarSpacing=a.model().timeScale().barSpacing.bind(a.model().timeScale());this._invalidated=!0};TradingView.W52.prototype.update=function(){this._invalidated=!0};
|
|
TradingView.W52.prototype._updateImpl=function(){this._points1=[];this._points2=[];this._timePoints=[];if(this._visible()){var a=this.D98.priceScale(),b=this.D98.D99.timeScale();if(a&&!a.isEmpty()&&!this.D98.D99.timeScale().isEmpty()&&!this.D98._series.bars().isEmpty()){var c=this.D98.data()._columns.indexOf(this._plotAId())+1,d=this.D98.data()._columns.indexOf(this._plotBId())+1,e=this.D98.D99.timeScale().visibleBars();if(!e.isEmpty()){var f=
|
|
this.D98.offset(this._plotAId()),g=this.D98._series.nearestIndex(e.firstBar(),SEARCH_NEAREST_RIGHT),e=this.D98._series.nearestIndex(e.lastBar(),SEARCH_NEAREST_LEFT);0<f?(g-=f,e+=f):(g+=f,e-=f);g=this.D98.data().range(g,e);if(0<this.D98.data()._items.length){this.D98.data();for(var e=this.D98.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.W52.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 AreaBackgroundRenderer(a)};
|
|
TradingView.W52.prototype._plotAId=function(){assert(!1,"Pure virtual call!")};TradingView.W52.prototype._plotBId=function(){assert(!1,"Pure virtual call!")};TradingView.W52.prototype._color=function(){assert(!1,"Pure virtual call!")};TradingView.W52.prototype._transparency=function(){assert(!1,"Pure virtual call!")};TradingView.W52.prototype._visible=function(){assert(!1,"Pure virtual call!")};
|
|
TradingView.W54=function(a){TradingView.W52.call(this,a)};inherit(TradingView.W54,TradingView.W52);TradingView.W54.prototype._plotAId=function(){return this.D98.properties().area[0].name.value()};TradingView.W54.prototype._plotBId=function(){return this.D98.properties().area[1].name.value()};TradingView.W54.prototype._color=function(){return this.D98.properties().areaBackground.backgroundColor.value()};
|
|
TradingView.W54.prototype._transparency=function(){return this.D98.properties().areaBackground.transparency.value()};TradingView.W54.prototype._visible=function(){return this.D98.properties().areaBackground.fillBackground.value()};
|
|
TradingView.D1=function(a,b,c){TradingView.W52.call(this,a);assert(b.type===StudyMetaInfo.FilledArea.TYPE_PLOTS,"Wrong filledArea type: "+b.type);this._fillMetaInfo=b;this._fillStyleProps=c};inherit(TradingView.D1,TradingView.W52);TradingView.D1.prototype._plotAId=function(){return this._fillMetaInfo.objAId};TradingView.D1.prototype._plotBId=function(){return this._fillMetaInfo.objBId};
|
|
TradingView.D1.prototype._color=function(){return this._fillStyleProps.color.value()};TradingView.D1.prototype._transparency=function(){return this._fillStyleProps.transparency.value()};TradingView.D1.prototype._visible=function(){return this._fillStyleProps.visible.value()};TradingView.W57=function(a,b){this.D98=b;this.Z1=a;this._points=new List;this._points.append(new MathEx.Point(-1,-1))};TradingView.W57.prototype.update=function(){var a=this.D98.priceScale();if(!a||a.isEmpty())this._points.setItem(0,new MathEx.Point(-1,-1));else{var b=this.Z1.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.W57.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.Z1.color.value();a.linewidth=this.Z1.linewidth.value();a.linestyle=this.Z1.linestyle.value();a.hitTestResult=HitTestResult.REGULAR;return new HorzLineRenderer(a)};function BandBackgroundRenderer(a){this._data=a}
|
|
BandBackgroundRenderer.prototype.draw=function(a){if(0!==this._data.points.length){var b=a.canvas.width;a.fillStyle=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)}};BandBackgroundRenderer.prototype.hitTest=function(a){return null};TradingView.W56=function(a){this.D98=a;this._points=[]};
|
|
TradingView.W56.prototype.update=function(){this._points=[];if(this.D98.properties().bandsBackground.fillBackground.value()){var a=this.D98.properties().bands[0],b=this.D98.properties().bands[1],c=this.D98.priceScale();c&&!c.isEmpty()&&(this._points.push(c.priceToCoordinate(a.value.value())),this._points.push(c.priceToCoordinate(b.value.value())))}};
|
|
TradingView.W56.prototype.renderer=function(){var a={};a.points=this._points;a.backcolor=this.D98.properties().bandsBackground.backgroundColor.value();a.transparency=this.D98.properties().bandsBackground.transparency.value();return new BandBackgroundRenderer(a)};
|
|
TradingView.W83=function(a,b,c){this.D98=a;this._points=[];assert(b.type===StudyMetaInfo.FilledArea.TYPE_HLINES,"Wrong filledArea type: "+b.type);this._initBandIndexes(b.objAId,b.objBId);this._fillStyleProps=c};
|
|
TradingView.W83.prototype._initBandIndexes=function(a,b){this._bandBKey=this._bandAKey=null;for(var c=0;c<this.D98.metaInfo().bands.length;++c){var d=this.D98.metaInfo().bands[c];void 0==this._bandAKey&&d.id===a?this._bandAKey=c:void 0==this._bandBKey&&d.id===b&&(this._bandBKey=c)}};
|
|
TradingView.W83.prototype.update=function(){this._points=[];if(this._fillStyleProps.visible.value()){var a=this.D98.properties().bands[this._bandAKey],b=this.D98.properties().bands[this._bandBKey],c=this.D98.priceScale();c&&!c.isEmpty()&&(this._points.push(c.priceToCoordinate(a.value.value())),this._points.push(c.priceToCoordinate(b.value.value())))}};
|
|
TradingView.W83.prototype.renderer=function(){var a={};a.points=this._points;a.backcolor=this._fillStyleProps.color.value();a.transparency=this._fillStyleProps.transparency.value();return new BandBackgroundRenderer(a)};function D49(){this._marksByIndex={};this._marksBySpan=[]}D49.prototype.minIndex=void 0;D49.prototype.maxIndex=void 0;
|
|
D49.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};
|
|
D49.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))};D49.prototype._sortByIndexAsc=function(a,b){return a.index-b.index};
|
|
D49.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};D49.prototype.addTail=function(a){for(var b=0;b<a.length;b++)a[b].index=this.maxIndex+b+1;this.merge(a)};D49.prototype.indexToTime=function(a){return(a=this._marksByIndex[a])?new Date(1E3*a.time):null};
|
|
D49.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,q=-Infinity,n=0;n<l;n++){for(var t=k[n],u=t.index;h<g;){var m=f[h],z=m.index;if(z<u)h++,d.push(m),q=z,m=Infinity;else{m=z;break}}m-u>=c&&u-q>=c&&(d.push(t),q=u)}for(;h<g;h++)d.push(f[h])}return this._cache=d};
|
|
D49.prototype.state=function(){for(var a=[],b=this._marksBySpan.length;b--;)this._marksBySpan[b]&&(a=a.concat(this._marksBySpan[b]));return{marks:a}};D49.prototype.restoreState=function(a){this._marksByIndex={};this._marksBySpan=[];delete this.maxIndex;delete this.minIndex;a&&a.marks&&a.marks.length&&this.merge(a.marks)};function TimePoint(a){this.m_date=a}TimePoint.prototype.date=function(){return this.m_date};TimePoint.prototype.setDate=function(a){this.m_date=a};var MONTH_NAMES=void 0,MINUTE_SPAN=20,HOUR_SPAN=30,DAY_SPAN=40,WEEK_SPAN=50,MONTH_SPAN=60,YEAR_SPAN=70,DEFAULT_BAR_SPACING=6,MAX_BAR_SPACING=50,MIN_BAR_SPACING=0.5,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 D48(a,b){this.D99=a;this.Z1=b;this.m_width=0;this._defaultRightOffset=this.Z1.rightOffset.value();this.m_rightOffset=this.Z1.rightOffset.value();this.m_points=new TimeIndexes;this.m_barSpacing=this.Z1.barSpacing.value();this.m_stateSnapshot=this.m_scaleStartPoint=this.m_scrollStartPoint=null;this.m_tickmarks=new D49;this._locked=!1}
|
|
D48.prototype.reset=function(){this._visibleBarsCache=null;this.m_points=new TimeIndexes;this.m_stateSnapshot=this.m_scaleStartPoint=this.m_scrollStartPoint=null;this.m_tickmarks=new D49};D48.prototype.restoreDefault=function(){this._visibleBarsCache=null;this.m_barSpacing=DEFAULT_BAR_SPACING;this.m_rightOffset=this.Z1.rightOffset.value();this.saveDefault("barSpacing");this._correctOffset();this.recalcLockedScale()};D48.prototype.rightOffset=function(){return this.m_rightOffset};
|
|
D48.prototype.scrollToRealtime=function(a){var b=this.Z1.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.D99;$({offset:a}).animate({offset:b},{duration:1E3,easing:"easeInOutQuint",step:function(a){c._visibleBarsCache=null;c.m_rightOffset=a;e.recalculateAllPanes();e.Z19(new Q22(Q22.LIGHT_UPDATE));e.recalcVisibleRangeStudy(e.Z18())}})}else this._visibleBarsCache=
|
|
null,this.m_rightOffset=b,this._correctOffset()};D48.prototype.points=function(){return this.m_points};D48.prototype.width=function(){return this.m_width};D48.prototype.barSpacing=function(){return this.m_barSpacing};D48.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())};
|
|
D48.prototype.visibleBars=function(){if(this._visibleBarsCache)return this._visibleBarsCache;if(this.isEmpty())TradingView.logDebug("D48.visibleBars: time scale is empty");else{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)}};D48.prototype.isEmpty=function(){return 0===this.m_width||0===this.m_points.size()};
|
|
D48.prototype.indexToCoordinate=function(a,b){if(this.isEmpty())return TradingView.logDebug("D48.indexToCoordinate: time scale is empty"),0;if(!isInteger(a))return TradingView.logDebug("D48.indexToCoordinate: incorrect index"),0;var c=this.m_points.lastTimePointIndex()+this.m_rightOffset-a,c=this.m_width-(c+0.5)*this.m_barSpacing;return b?c:Math.round(c)};
|
|
D48.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+0.5)*this.m_barSpacing;a[b].time=Math.round(c);a[b].exactTime=c}};D48.prototype.indexesToCoordinates=function(a){a=a.toArray();for(var b=0;b<a.length;b++){var c=a[b].x,c=this.m_points.lastTimePointIndex()+this.m_rightOffset-c;a[b].x=Math.round(this.m_width-(c+0.5)*this.m_barSpacing)}};
|
|
D48.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)};
|
|
D48.prototype.timeToCoordinate=function(a){function b(a){return 0>=a||a>=this.m_width}var c=this.m_points.closestIndexLeft(a),d=this.m_points.valueAt(c),c=this.indexToCoordinate(c,!0);if(b(c))return null;var e=this.barSpacing(),f=function(){var a=this.m_points.lastTimePointIndex();return this.m_points.valueAt(a)-this.m_points.valueAt(a-1)}.call(this);a=Math.round(c+(a-d)/f*e)+1;return b(a)?null:a};
|
|
D48.prototype.alignCoordinate=function(a){if(this.isEmpty())return a;a=this.coordinateToIndex(a);return this.indexToCoordinate(a)};D48.prototype.timePointToIndex=function(a){return this.m_points.indexOf(a,!0)};D48.prototype.indexToTimePoint=function(a){return(a=this.m_points.valueAt(a))?new Date(1E3*a):null};D48.prototype.indexToUserTime=function(a){return this.m_tickmarks.indexToTime(a)};
|
|
D48.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>=DAY_SPAN?1:0})}}return c};
|
|
D48.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};
|
|
D48.prototype.restoreState=function(a,b,c){this._visibleBarsCache=null;void 0===a.m_barSpacing?TradingView.logDebug("D48.restoreState: invalid state"):void 0===a.m_rightOffset?TradingView.logDebug("D48.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),lastIndex=this.m_points.lastTimePointIndex(),offset=
|
|
lastIndex-c,this.m_rightOffset=-offset+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())};D48.prototype.setOffset=function(a){this._visibleBarsCache=null;void 0===a?TradingView.logDebug("D48.setOffset: invalid state"):(this.m_rightOffset=a,this._correctOffset())};
|
|
D48.prototype.setBarSpacing=function(a){this._visibleBarsCache=null;void 0===a?TradingView.logDebug("D48.setBarSpacing: invalid state"):this.m_barSpacing=a};D48.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)}};
|
|
D48.prototype.maxOffset=function(){return this.m_width/this.m_barSpacing-10};D48.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())};
|
|
D48.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<MIN_BAR_SPACING?this.m_barSpacing=MIN_BAR_SPACING:this.m_barSpacing>MAX_BAR_SPACING&&(this.m_barSpacing=MAX_BAR_SPACING),this._correctOffset(),this.recalcLockedScale())}};
|
|
D48.prototype.endScale=function(){null!==this.m_scaleStartPoint&&(this.m_stateSnapshot=this.m_scaleStartPoint=null,this.saveDefault("barSpacing"))};D48.prototype.saveDefault=function(a){TradingView.saveDefaultProperties(!0);this.Z1[a].setValue(this["m_"+a]);TradingView.saveDefaultProperties(!1)};D48.prototype.startScroll=function(a){null!==this.m_scrollStartPoint||null!==this.m_stateSnapshot||this.isEmpty()||(this.m_scrollStartPoint=a,this.m_stateSnapshot=this.state())};
|
|
D48.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.D99.mainSeries().priceScale().properties().percentage.value()&&this.recalcLockedScale())};
|
|
D48.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.D99;(function h(){c._visibleBarsCache=null;var k=(new Date-e)/b;1<=k?(c.m_rightOffset=a,c._visibleBarsCache=null,f.recalculateAllPanes(),f.Z19(new Q22(Q22.LIGHT_UPDATE))):
|
|
(c.m_rightOffset=d+(a-d)*k,f.recalculateAllPanes(),setTimeout(h,20))})()};D48.prototype.endScroll=function(){null!==this.m_scrollStartPoint&&(this.m_stateSnapshot=this.m_scrollStartPoint=null)};D48.prototype._currentSavedPosition=function(){if(!this.isEmpty()){var a=this.m_points.indexOf(this.m_restoredLastTimePoint,!0);isInteger(a)&&(a=this.m_points.lastTimePointIndex()-a,this.m_rightOffset-=a);delete this.m_restoredLastTimePoint}};
|
|
D48.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()};D48.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};
|
|
D48.prototype.formatLabel=function(a,b){if(!(a&&a instanceof Date))return"incorrect time";var c=this.D99.mainSeries().isDWM();return b<MINUTE_SPAN&&!c?numberToStringWithLeadingZero(a.getUTCHours(),2)+":"+numberToStringWithLeadingZero(a.getUTCMinutes(),2)+":"+numberToStringWithLeadingZero(a.getUTCSeconds(),2):b<DAY_SPAN&&!c?numberToStringWithLeadingZero(a.getUTCHours(),2)+":"+numberToStringWithLeadingZero(a.getUTCMinutes(),2):b<WEEK_SPAN||b<MONTH_SPAN?a.getUTCDate():b<YEAR_SPAN?(MONTH_NAMES||
|
|
(MONTH_NAMES=_createMonthNames()),MONTH_NAMES[a.getUTCMonth()]):a.getUTCFullYear()};D48.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}};
|
|
D48.prototype.denormalizeTimePoint=function(a){var b=this.m_points.indexOf(a.time_t);return void 0===b?void 0:b+a.offset};D48.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}};
|
|
D48.prototype.recalcLockedScale=function(){if(this.D99.m_mainSeries.properties().lockScale.value()&&!this.isEmpty()){var a=this.D99.m_mainSeries.priceScale(),b=this.D99.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[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))}}};D48.prototype.correctBarSpacing=function(){!this.isEmpty()&&this.points().size()<this.width()/this.barSpacing()&&(this.setOffset(DEFAULT_RIGHT_OFFSET),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),MAX_BAR_SPACING)))};
|
|
D48.prototype.canZoomIn=function(){return this.m_barSpacing<MAX_BAR_SPACING};D48.prototype.canZoomOut=function(){return this.m_barSpacing>MIN_BAR_SPACING};function SelectionRenderer(a){this._data=a}SelectionRenderer.RADIUS=3.5;SelectionRenderer.prototype.tolerance=2;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.size();c++){var d=this._data.points.item(c);void 0===d.x||isNaN(d.x)||null===d.x||void 0===d.y||isNaN(d.y)||null===d.y||this._drawMarker(a,d,b)}}};
|
|
SelectionRenderer.prototype._drawMarker=function(a,b,c){a.beginPath();a.arc(b.x+0.5,b.y+0.5+c,SelectionRenderer.RADIUS,0,2*Math.PI,!0);a.closePath();a.fill();a.stroke()};SelectionRenderer.prototype.hitTest=function(a){if(!this._data)return null;for(var b=0;b<this._data.points.size();b++){var c=this._data.points.item(b);if(c.substract(a).length()<=SelectionRenderer.RADIUS+this.tolerance)return new HitTestResult(this._data.hittestResult,c.data)}return null};
|
|
function LineAnchor(a,b){this._data=a;this.D99=b;this.radius=this._data.radius||LineAnchor.OUTER_RADIUS}LineAnchor.OUTER_RADIUS=TradingView.isMobile.any()?16:8;LineAnchor.prototype.tolerance=2;
|
|
LineAnchor.prototype.draw=function(a){for(var b=this._data.currentPoint,c=this._data.outerStrokeWidth||1,d=0;d<this._data.points.size();d++){var e=this._data.points.item(d),f=e.substract(b).length(),g=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()))}};
|
|
LineAnchor.prototype.hitTest=function(a){for(var b=0;b<this._data.points.size();b++){var c=this._data.points.item(b);if(c.substract(a).length()<=this.radius+this.tolerance)return new HitTestResult(this._data.hittestResult,c.data)}return null};SelectionRendererArrowsUpDown=function(a){SelectionRenderer.call(this,a)};inherit(SelectionRendererArrowsUpDown,SelectionRenderer);
|
|
SelectionRendererArrowsUpDown.prototype._drawMarker=function(a,b,c){var d=b.isUp?1:-1,e=D53.prototype._calculateVerticalOffset(this._data.barSpacing),f=D53.prototype._calculateMinHeight(this._data.barSpacing);c=c+d*e+d*f;a.beginPath();a.arc(b.x+0.5,b.y+0.5+c,SelectionRenderer.RADIUS,0,2*Math.PI,!0);a.closePath();a.fill();a.stroke()};function CompositeRenderer(){this._renderers=new List}CompositeRenderer.prototype.append=function(a){this._renderers.append(a)};CompositeRenderer.prototype.draw=function(a){for(var b=0;b<this._renderers.size();b++)a.save(),this._renderers.item(b).draw(a),a.restore()};CompositeRenderer.prototype.drawBackground=function(a){for(var b=0;b<this._renderers.size();b++)this._renderers.item(b).drawBackground&&this._renderers.item(b).drawBackground(a)};
|
|
CompositeRenderer.prototype.hitTest=function(a){for(var b=this._renderers.size()-1;0<=b;b--){var c=this._renderers.item(b).hitTest(a);if(c)return c}return!1};function SelectionIndexes(){}SelectionIndexes.DENSITY=10;SelectionIndexes.prototype.calc=function(a,b){for(var c=new List,d=a;d<=b;d++)0===d%SelectionIndexes.DENSITY&&c.append(d);return c};function D47(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.D99=a.D99}inherit(D47,PriceAxisView);D47.prototype.update=function(){this._invalidated=!0};D47.prototype.setActive=function(a){this._active=a};
|
|
D47.prototype._updateImpl=function(){this._visible=!1;this._text="";if(this.D99.timeScale()&&!this.D99.timeScale().isEmpty()&&this._linetool.priceScale()&&!this._linetool.priceScale().isEmpty()&&!(this.D99.selectedSource()!==this._linetool&&!this._linetool.customization.forcePriceAxisLabel||this.D99.timeScale().visibleBars().isEmpty()||this._linetool.points().size()<=this._pointIndex)){var a=this._linetool.points().item(this._pointIndex);if(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}}};
|
|
D47.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return new 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})};D47.prototype.text=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return PriceAxisView.prototype.text.call(this)};
|
|
function LineToolTimeAxisView(a,b){TimeAxisView.call(this);this._linetool=a;this._pointindex=b;this.D99=a.D99;this._text="";this._coordinate=0;this._background="#5592C9";this._activeBackground="#0F6DBF";this._borderColor="#2E84A6";this._color="white";this._visible=!1;this._textHeight=14}inherit(LineToolTimeAxisView,TimeAxisView);LineToolTimeAxisView.prototype.setActive=function(a){this._active=a};
|
|
LineToolTimeAxisView.prototype.update=function(){this._visible=!1;if(!(this.D99.timeScale().isEmpty()||this._linetool.points().size()<=this._pointindex||this._linetool!==this.D99.selectedSource())){this._text="";var a=this._linetool.points().item(this._pointindex).index;this._coordinate=this.D99.timeScale().indexToCoordinate(a);if(a=this.D99.timeScale().indexToUserTime(a))this._text=(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(a);this._visible=!0}};
|
|
LineToolTimeAxisView.prototype.renderer=function(){return new 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})};
|
|
function D46(a,b,c){DataSource.call(this);this.D99=a;this.Z1=c;c.visible&&c.frozen||this.Z1.merge(defaults("linetool"));$.isArray(b)?this._paneViews=b:this._paneViews=[b];this._points=new List;this._fixedPoints=new List;this._timePoint=new List;this.Z1.symbol||(this.Z1.merge({symbol:a.mainSeries().symbol()}),(b=a.mainSeries().symbolInfo())&&this.Z1.merge({symbolInfo:{listed_exchange:b.listed_exchange,short_name:b.name}}));this.Z1.interval||
|
|
this.Z1.merge({interval:a.mainSeries().interval()});this.Z1.addExclusion&&(this.Z1.addExclusion("symbol"),this.Z1.addExclusion("symbolInfo"),this.Z1.addExclusion("points"),this.Z1.addExclusion("interval"),this.Z1.addExclusion("visible"));this.calcIsActualSymbol();this.Z1.listeners().subscribe(this,D46.prototype.propertiesChanged);this._createPointsProperties();"_tooltipFieldsHash"in this&&!this.hasOwnProperty("_tooltipFieldsHash")&&
|
|
(this._tooltipFieldsHash=$.extend(!0,{},this._tooltipFieldsHash));this.m_priceAxisViews=new List;this.m_timeAxisViews=new List;if(0<this.pointsCount())for(a=0;a<this.pointsCount();a++)this.m_priceAxisViews.append(this.createPriceAxisView(a)),this.m_timeAxisViews.append(new LineToolTimeAxisView(this,a));this.Z1.visible.listeners().subscribe(this,function(a){a.value()||this.D99.selectedSource()!=this||this.D99.setSelectedSource(null)});this.customization=this.customization||{forcePriceAxisLabel:!1,
|
|
disableSelection:!1,disableErasing:!1};$(window).resize(function(){this.isFixed()&&this.restoreFixedPoints()}.bind(this))}inherit(D46,DataSource);D46.LINEEND_NORMAL=0;D46.LINEEND_ARROW=1;D46.LINEEND_CIRCLE=2;D46.PointPriceProperty=function(a,b){Property.call(this);this._lineSource=a;this._pointIndex=b};inherit(D46.PointPriceProperty,Property);D46.prototype.getType=function(){return TradingView.className(this.constructor)};
|
|
D46.prototype.getConstructor=function(){return this._constructor||null};D46.prototype.isActualSymbol=function(){return this._isActualSymbol};D46.prototype.calcIsActualSymbol=function(){var a=this.Z1,b=this.D99.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]};
|
|
D46.PointPriceProperty.prototype.value=function(){var a=this._lineSource.points().item(this._pointIndex).price;return parseFloat(this._lineSource.priceScale().formatter().format(a))};D46.PointPriceProperty.prototype.setValue=function(a){var b=this._lineSource.points().item(this._pointIndex);b.price=parseFloat(a);this._lineSource.setPoint(this._pointIndex,b);this._lineSource.D99.updateSource(this._lineSource);this._listeners.fire(this);this._lineSource.endChanging()};
|
|
D45=function(a,b){Property.call(this);this._lineSource=a;this._pointIndex=b};inherit(D45,Property);D45.prototype.value=function(){return this._lineSource.points().item(this._pointIndex).index};
|
|
D45.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.D99.updateSource(this._lineSource);this._listeners.fire(this);this._lineSource.endChanging()};
|
|
D46.prototype._createPointsProperties=function(){this.Z1.addProperty("points");for(var a=this.Z1.points,b=0;b<this.pointsCount();b++){a.addProperty(b);var c=a[b];c.addProperty("price");c.price=new D46.PointPriceProperty(this,b);c.addProperty("bar");c.bar=new D45(this,b)}};D46.prototype.priceScale=function(){return this._ownerSource?this._ownerSource.m_priceScale:null};D46.prototype.symbol=function(){return this.Z1.symbol.value()};
|
|
D46.prototype.properties=function(){return this.Z1};D46.prototype.isSavedInStudyTemplates=function(){return!1};
|
|
D46.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()};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);return b};
|
|
D46.prototype.template=function(){var a=this.properties().state();delete a.points;delete a.symbol;delete a.symbolInfo;return a};D46.prototype.restoreTemplate=function(a){delete a.symbolInfo;this.D99._undoModel.drawingLoadTemplate(this,a)};D46.prototype.clearData=function(){this._points=new List};D46.prototype.currentPointsetId=function(){return"pointset_"+this._currentPointsetId};
|
|
D46.prototype.stop=function(){this._currentPointsetId&&(this.D99.chartApi().removePointset(this.currentPointsetId()),this._currentPointsetId=null)};D46.prototype.isStarted=function(){return!!this._currentPointsetId};D46.prototype.restart=function(){this.isFixed()||(this._currentPointsetId=0,this.createServerPoints())};D46.prototype.tryCreateServerPoints=function(){this.isFixed()||this._currentPointsetId||this.createServerPoints()};
|
|
D46.prototype.normalizePoint=function(a){var b=this.D99.timeScale().normalizeBarIndex(a.index);b.price=a.price;return b};D46.prototype.normalizePoints=function(){this._timePoint.clear();for(var a=0;a<this._points.size();a++){var b=this.D99.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)}};
|
|
D46.prototype.denormalizeTimePoints=function(){for(var a=[],b=0;b<this._timePoint.size();b++){var c=this.D99.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))};D46.prototype.restorePoints=function(a,b,c){this._timePoint=new List(a);this._points=new List(b);c||this.denormalizeTimePoints()};
|
|
D46.prototype.restorePositionPercents=function(a){this._positionPercents=new List(a)};D46.prototype.propertiesChanged=function(){this.updateAllViews();this.D99.updateSource(this)};
|
|
D46.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};
|
|
D46.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.D99.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};D46.prototype.addPoint=function(a,b){b&&b.shift&&2<=this.points().size()&&this.Z1.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._points.append(a);(c=this._points.size()==this.pointsCount())?(this._lastPoint=null,this.normalizePoints(),this.createServerPoints()):this._lastPoint=a;return c};
|
|
D46.prototype.addFixedPoint=function(a){this._fixedPoints.append(a);(a=this._fixedPoints.size()==this.pointsCount())&&this.calcPositionPercents();return a};
|
|
D46.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.D99.timeScale().width(),b=b.y/this.priceScale().height();this._positionPercents.append({x:c,y:b})}return this._positionPercents};D46.prototype.restoreFixedPoints=function(){this._fixedPoints=this.fixedPoints()};
|
|
D46.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.updateAllViews();this.D99.updateSource(this)}};
|
|
D46.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)}};D46.prototype.startChanging=function(a,b){a<this.m_priceAxisViews.size()&&this.m_priceAxisViews.item(a).setActive(!0);a<this.m_timeAxisViews.size()&&this.m_timeAxisViews.item(a).setActive(!0)};
|
|
D46.prototype.setPoint=function(a,b,c){c&&c.shift&&this.Z1.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()};
|
|
D46.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};D46.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()};
|
|
D46.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)}};D46.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))};
|
|
D46.prototype.endMoving=function(){this.Z1.interval.setValue(this.D99.mainSeries().interval());var a=!1;this._currentMovingPoint&&this._startMovingPoint&&(a=this._currentMovingPoint.index!=this._startMovingPoint.index,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(),a&&
|
|
this.createServerPoints())};D46.prototype.endChanging=function(){this.Z1.interval.setValue(this.D99.mainSeries().interval());this.normalizePoints();this.createServerPoints();for(var a=0;a<this.m_priceAxisViews.size();a++)this.m_priceAxisViews.item(a).setActive(!1);for(a=0;a<this.m_timeAxisViews.size();a++)this.m_timeAxisViews.item(a).setActive(!1)};
|
|
D46.prototype.paneViews=function(a){if(!this._isActualSymbol||!this.Z1.visible.value()||TradingView.drawingState.hideAllDrawings().value()&&this.userEditEnabled())return null;a=new List;for(var b=this._paneViews.length-1;0<=b;--b)a.append(this._paneViews[b]);return a};D46.prototype.dataWindowView=function(){return null};D46.prototype.statusView=function(){return null};
|
|
D46.prototype.priceAxisViews=function(a,b){if(this._isActualSymbol&&a.Z18().contains(this)&&b===this.priceScale()){var c=new List;if(this.D99.lineBeingEdited()===this){var d=this.D99.linePointBeingEdited();if(d<this.m_priceAxisViews.size()){var c=this.m_priceAxisViews.clone(),e=c.item(d);c.removeAt(d);c.append(e);return c}}return this.m_priceAxisViews}return null};
|
|
D46.prototype.timeAxisViews=function(){if(this.D99.lineBeingEdited()===this){var a=this.D99.linePointBeingEdited();if(a<this.m_timeAxisViews.size()){var b=this.m_timeAxisViews.clone(),c=b.item(a);b.removeAt(a);b.append(c);return b}}return this.m_timeAxisViews};
|
|
D46.prototype.updateAllViews=function(){var a=this.paneViews();if(null!==a)for(var b=0;b<a.size();b++)a.item(b).update();for(b=0;b<this.m_priceAxisViews.size();b++)this.m_priceAxisViews.item(b).update();for(b=0;b<this.m_timeAxisViews.size();b++)this.m_timeAxisViews.item(b).update()};
|
|
D46.prototype.setLastPoint=function(a,b){b&&b.shift&&2<=this.points().size()&&this.Z1.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()};D46.prototype.setLastFixedPoint=function(a){this._lastFixedPoint=a;this.updateAllViews()};D46.prototype.title=function(){return"Line Tool"};
|
|
D46._pointSetId=1;D46.prototype.start=function(){this.createServerPoints()};
|
|
D46.prototype.createServerPoints=function(){if(!this._recursiveGuard&&this._isActualSymbol&&this.D99.chartApi().connected()&&(this._currentPointsetId&&this.D99.chartApi().removePointset(this.currentPointsetId()),!this.D99.timeScale().isEmpty()&&(0===this._timePoint.size()&&this.normalizePoints(),0!==this._timePoint.size()))){this._currentPointsetId=++D46._pointSetId;for(var a=this.D99.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.D99.chartApi().createPointset(this.currentPointsetId(),"turnaround",a,b,c,function(a){f.onData(a)})}};D46.prototype.isBeingEdited=function(){return this===this.D99.lineBeingEdited()||this===this.D99.sourceBeingMoved};D46.prototype.isFixed=function(){return this.properties().locked&&this.properties().locked.value()};
|
|
D46.prototype.isLocked=D46.prototype.isFrozen=function(){return this.properties().frozen&&this.properties().frozen.value()};D46.prototype._tooltipFieldsHash={};D46.prototype._tooltipFieldsOrder="time price index time0 price0 time1 price1 time2 price2 time3 price3 time4 price4 distance term pointsPerBar".split(" ");D46.prototype._tooltipFieldsOrdered=null;
|
|
D46.prototype._formatTooltip=function(){null===this._tooltipFieldsOrdered&&(this._tooltipFieldsOrdered=new OrderedHash(this._tooltipFieldsHash,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 />")};
|
|
D46.prototype.pointToScreenPoint=function(a){var b=this.D99.timeScale(),c=this.priceScale();if(!c||c.isEmpty()||b.isEmpty())return 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]};D46.prototype.screenPointToPoint=function(a){var b=this.D99.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}};D46.prototype.tags=function(){return[this._constructor]};
|
|
D46.prototype._snapPoint45Degree=function(a,b,c){var d=this.D99.timeScale(),e=d.indexToCoordinate(b.index),f=d.indexToCoordinate(a.index)-e,g=this.m_priceScale,h=b.price,k=a.price;firstValue=this.ownerSource().firstValue();g.isPercent()&&(h=g.priceRange().convertToPercent(h,firstValue));var l=g.priceToCoordinate(h),k=g.priceToCoordinate(k)-l;switch(Math.round(4*(Math.atan2(f,k)/Math.PI))){case 2:case -2:if(!c){a.price=h;break}case 0:case 4:case -4:if(!c){a.index=b.index;break}default: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)),correctedDiff=Math.abs(d.indexToCoordinate(f)-e),d=g.coordinateToPrice(l+correctedDiff*b),a.index=f,a.price=d}};D46.prototype.createPriceAxisView=function(a){return new D47(this,a)};D46.prototype.version=1;D46.isLineTool=function(a){return(a=TradingView[a])?isInherited(a,D46):!1};Q63=function(a,b,c,d){var e=new W91(this,a);b.push(e);D46.call(this,a,b,c);this.properties().listeners().subscribe(this,Q63.prototype.changeStyles);this._constructor=d;this._inputs=this._graphics=this._metaInfo=this._indexes=this._nonseriesdata=this._studyId=null};inherit(Q63,D46);
|
|
Q63.prototype.pointsCount=function(){throw Error("Reimplement this in a child class");};Q63.prototype.title=function(){return this._metaInfo.description};Q63.prototype.studyId=function(){return this._metaInfo.id};Q63.prototype._requestStudy=function(){throw Error("Reimplement this in a child class");};
|
|
Q63.prototype.changeStyles=function(){if(this._inputs){var a=Q0.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=Q0.splitInputs(this.properties().inputs.state());this._inputs=TradingView.clone(a.obj);this._requestStudy()}};
|
|
Q63.prototype._checkTurnaround=function(a){return a===this._turnaround||a==this.D99.mainSeries()._turnaround||a===this.D99.mainSeries()._turnaround+"_"+this._turnaround};Q63.prototype.stop=function(){D46.prototype.stop.call(this);this._studyId&&this.D99.chartApi().removeStudy(this._studyId)};Q63.prototype.onData=function(a){throw Error("Reimplement this in a child class");};
|
|
Q63.prototype._correctedPoint=function(a){var b=parseInt(this.D99.mainSeries().bars().first(),10),c=parseInt(this.D99.mainSeries().bars().last(),10);a.index=Math.max(a.index,b);a.index=Math.min(a.index,c);return a};Q63.prototype.addPoint=function(a){return D46.prototype.addPoint.call(this,this._correctedPoint(a))};
|
|
Q63.prototype.setLastPoint=function(a){return D46.prototype.setLastPoint.call(this,this._correctedPoint(a))};Q63.prototype.move=function(a){};Q63.prototype.clearData=function(){this._indexes=this._nonseriesdata=null;this._graphics=new Q62(this._metaInfo);this.updateAllViews()};
|
|
Q63.prototype.state=function(a){var b=D46.prototype.state.call(this,a);a&&(b.nonseriesdata=this._nonseriesdata,b.nonseriesindexes=this._indexes,b.graphics=this._graphics.graphics());this.metaInfo()instanceof StudyMetaInfo?b.metaInfo=this.metaInfo().state():(b.metaInfo=$.extend({},this.metaInfo()),b.metaInfo.id=StudyMetaInfo.parseIdString(b.metaInfo.id+(b.metaInfo.version?"-"+b.metaInfo.version:"")).fullId);return b};
|
|
Q63.prototype.restoreData=function(a){this._nonseriesdata=a.nonseriesdata?a.nonseriesdata:null;this._indexes=a.nonseriesindexes?a.nonseriesindexes:null;this._graphics.setGraphics(a.graphics?a.graphics:Q62.emptyGraphics())};Q63.prototype.setPoint=function(a,b){this._indexes=this._nonseriesdata=null;D46.prototype.setPoint.call(this,a,this._correctedPoint(b))};
|
|
Q63.prototype.disconnect=function(){this._studyId=0};Q63.prototype.graphics=function(){return this._graphics.graphics()};Q63.prototype.firstValue=function(){return this.D99.mainSeries().data().firstValue()};Q63.prototype.formatter=function(){return this.D99.mainSeries().data().formatter()};Q63.prototype.metaInfo=function(){return this._metaInfo};
|
|
function W91(a,b){W89.call(this,a,b)}inherit(W91,W89);
|
|
W91.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size()||this.D98._nonseriesdata||this.D98._graphics&&!this.D98._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.D98._doNotNeedLine?0:1;d.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new VertLineRenderer(d));d={};d.points=(new List).append(c);
|
|
d.color="#808080";d.linewidth=this.D98._doNotNeedLine?0:1;d.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new VertLineRenderer(d));b={points:(new List).append(b).append(c),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:"#808080",linewidth:this.D98._doNotNeedLine?0:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));return a};
|
|
function D30(a,b){W89.call(this,a,b)}inherit(D30,W89);D30.prototype.renderer=function(){var a=new CompositeRenderer;this.isAnchorsRequired()&&(a.append(new SelectionRenderer({points:this._points})),a.append(this.createLineAnchor({points:this._points})));return a};Q67=function(a){this._data=a};Q67.prototype.hitTest=function(a){return null};
|
|
Q67.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;"left"==this._data.align&&(c=b+4+2-1);a.save();a.translate(0.5,0.5);a.fillRect(c-4-2-b,this._data.coordinate-this._data.textHeight/2-1,b+4+2,this._data.textHeight+2);a.fillStyle=this._data.color;a.textBaseline="middle";a.fillText(this._data.text,c-2-b,this._data.coordinate);a.restore()};
|
|
TradingView.D37=function(a,b,c,d){this.D99=a;this.D98=b;this._plotIndex=c;this._getterName=d?d:"symbol";this._cache={}};TradingView.D37.prototype.update=function(){this._visible=!1;var a=this.D98.lastValueData(this._plotIndex,!1);a&&this.D98.priceScale().properties().showSymbolLabels.value()&&(this._visible=!0,this._coordinate=a.coordinate,this._color=a.color,this._text=this.D98[this._getterName](),this._textHeight=this.D98.priceScale().m_markBuilder.fontHeight())};
|
|
TradingView.D37.prototype.renderer=function(){if(!this._visible)return new CompositeRenderer;var a=this.D99.paneForSource(this.D98),b="right";a.leftPriceScale()==this.D98.priceScale()&&(b="left");var c=this.D99.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 CompositeRenderer;
|
|
b={coordinate:this._coordinate,backColor:this._color,color:(new RGBColor(this._color)).blackWhiteContrast(),text:this._text,pos:this.D99.timeScale().width(),textHeight:this._textHeight,align:b};return new Q67(b)};function PoligonRenderer(a,b){this._data=a;this._hittest=b?b:new HitTestResult(HitTestResult.MOVEPOINT)}
|
|
PoligonRenderer.prototype.draw=function(a){if(!this._data.points.isEmpty()){a.beginPath();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);a.moveTo(b.x,b.y);for(b=0;b<this._data.points.size();b++){var c=this._data.points.item(b);a.lineTo(c.x,c.y)}this._data.filled&&this._data.fillBackground&&(a.fillStyle=generateColor(this._data.backcolor,this._data.transparency),a.fill());this._data.filled&&!this._data.skipClosePath&&
|
|
a.closePath();0<this._data.linewidth&&a.stroke()}};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._data.points.size();c++){var d=this._data.points.item(c-1),e=this._data.points.item(c);if(MathEx.distanceToSegment(d,e,a).distance<=b)return this._hittest}return this._data.filled&&this._data.fillBackground&&MathEx.isInPolygon(this._data.points,a)?this._hittest:null};TradingView.W59=function(a,b){W89.call(this,a,b)};inherit(TradingView.W59,W89);
|
|
TradingView.W59.prototype.renderer=function(){if(this._pattern&&2==this.D98.points().size()){var a=this.D98.points().item(0).index,b=this.D98.points().item(1).index,b=a<b?this._points.item(0):this._points.item(1);if(!b)return new CompositeRenderer;var c=Math.abs((this._points.item(0).x-this._points.item(1).x)/(this._pattern.length-1));if(this.D98.properties().mode.value()==TradingView.LineToolBarsPattern.BARS_MODE){a=new CompositeRenderer;new List;for(var d=0;d<this._pattern.length;d++){var e=
|
|
Math.round(b.x+d*c+0.5),f=b.y+Math.round(this._pattern[d].high),g=b.y+Math.round(this._pattern[d].low),h={};h.points=(new List).append(new MathEx.Point(e-1,f)).append(new MathEx.Point(e+1,g));h.color=this.D98.properties().color.value();h.linewidth=1;h.backcolor=this.D98.properties().color.value();h.fillBackground=!0;h.transparency=10;a.append(new RectangleRenderer(h))}}else a=new CompositeRenderer,h={},h.barSpacing=c,h.items=this._pattern,h.histogramBase=0,h.lineIndex=0,h.lineColor=generateColor(this.D98.properties().color.value(),
|
|
10),h.lineStyle=CanvasEx.LINESTYLE_SOLID,h.lineWidth=2,h.hittest=new HitTestResult(HitTestResult.MOVEPOINT),a.append(new D67(h));this.isAnchorsRequired()&&a.append(this.createLineAnchor({points:this._points}))}else{a=new 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);d={};d.points=(new List).append(b);d.color="#808080";d.linewidth=1;d.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new VertLineRenderer(d));
|
|
d={};d.points=(new List).append(c);d.color="#808080";d.linewidth=1;d.linestyle=CanvasEx.LINESTYLE_SOLID;a.append(new VertLineRenderer(d));b={points:(new List).append(b).append(c),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(b))}return a};
|
|
TradingView.W59.prototype.update=function(){W89.prototype.update.call(this);if(this.D98.priceScale()&&!(this.D98.priceScale().isEmpty()||2>this._points.size()))if(this.D98._pattern&&0<this.D98._pattern.length&&2==this.D98.points().size()){var a=Math.abs((this._points.item(0).x-this._points.item(1).x)/(this.D98._pattern.length-1)),b=this.D98.priceScale(),c=this.D98._pattern;if(this.D98.properties().mode.value()==TradingView.LineToolBarsPattern.BARS_MODE){this._pattern=
|
|
[];if(b.isPercent()){for(var d=this.D98.ownerSource().firstValue(),e=[],f=b.priceRange(),g=c.length;g--;)e[g]=[],e[g][HIGH_PLOT]=f.convertToPercent(c[g][HIGH_PLOT],d),e[g][LOW_PLOT]=f.convertToPercent(c[g][LOW_PLOT],d);c=e}d=b.priceToCoordinate(c[0][HIGH_PLOT]);for(g=0;g<c.length;g++)a=b.priceToCoordinate(c[g][HIGH_PLOT])-d,e=b.priceToCoordinate(c[g][LOW_PLOT])-d,this._pattern.push({high:a,low:e})}else{this._pattern=new List;if(b.isPercent()){d=this.D98.ownerSource().firstValue();e=[];f=b.priceRange();
|
|
for(g=c.length;g--;)e[g]=[],e[g][CLOSE_PLOT]=f.convertToPercent(c[g][CLOSE_PLOT],d);c=e}d=b.priceToCoordinate(c[0][CLOSE_PLOT]);g=this.D98.points().item(0).index;e=this.D98.points().item(1).index;e=this._points.item(g>e?1:0);f=e.x;for(g=0;g<c.length;g++){var h=e.y+b.priceToCoordinate(c[g][CLOSE_PLOT])-d,h=new MathEx.Point(f+g*a,h);this._pattern.append(h)}}}else delete this._pattern};
|
|
TradingView.LineToolBarsPattern=function(a,b){this._constructor="LineToolBarsPattern";var c=b?b:new W51("linetoolbarspattern");D46.call(this,a,new TradingView.W59(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")};inherit(TradingView.LineToolBarsPattern,D46);
|
|
TradingView.LineToolBarsPattern.BARS_MODE=0;TradingView.LineToolBarsPattern.LINE_MODE=1;
|
|
TradingView.LineToolBarsPattern.prototype.additionalActions=function(a){var b=new Action({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),c=new 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.D99.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.D99.updateSource(b)});return[b,c]};TradingView.LineToolBarsPattern.prototype.pointsCount=function(){return 2};TradingView.LineToolBarsPattern.prototype.state=function(a){a=D46.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][HIGH_PLOT],c=Math.min(a[0][LOW_PLOT],a[0][HIGH_PLOT]),d=Math.max(a[0][LOW_PLOT],a[0][HIGH_PLOT]),e=1;e<a.length;e++)c=Math.min(c,a[e][LOW_PLOT]),d=Math.max(d,a[e][HIGH_PLOT]);if(c<d)for(c=(c+d)/2,e=0;e<a.length;e++)a[e][HIGH_PLOT]=c-(a[e][HIGH_PLOT]-c),a[e][LOW_PLOT]=c-(a[e][LOW_PLOT]-c),a[e][OPEN_PLOT]=c-(a[e][OPEN_PLOT]-c),a[e][CLOSE_PLOT]=c-(a[e][CLOSE_PLOT]-c);b=a[0][HIGH_PLOT]-b;a=a[a.length-1][LOW_PLOT]-
|
|
a[0][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][LOW_PLOT]-this._pattern[0][HIGH_PLOT];this._points.item(1).price=this._points.item(0).price+a;this.updateAllViews()};
|
|
TradingView.LineToolBarsPattern.prototype.addPoint=function(a,b){var c=this.D99.mainSeries(),d=c.nearestIndex(a.index,SEARCH_NEAREST_RIGHT);this.properties().mode.value()==TradingView.LineToolBarsPattern.BARS_MODE?a.price=c.bars().valueAt(d)[HIGH_PLOT]:a.price=c.bars().valueAt(d)[CLOSE_PLOT];d=this.priceScale().priceRange().length();a.price+=0.05*d;d=c.priceScale();d.isPercent()&&(c=c.firstValue(),a.price=d.priceRange().convertToPercent(a.price,c));if(c=D46.prototype.addPoint.call(this,
|
|
a,b)){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.D99.mainSeries().nearestIndex(d,SEARCH_NEAREST_RIGHT),e=this.D99.mainSeries().nearestIndex(e,SEARCH_NEAREST_LEFT);this.points().item(0).index>this.points().item(1).index&&(this._points.item(0).price=this._points.item(1).price);for(this._pattern=[];d<=e;d++){var f=this.D99.mainSeries().data().valueAt(d);this._pattern.push(TradingView.clone(f))}}return c};
|
|
TradingView.LineToolBarsPattern.prototype.setPoint=function(a,b,c){var d=this._points.item(0).price-this._points.item(1).price;1==a&&b.index<=this._points.item(0).index&&(b.index=this._points.item(0).index+1);0==a&&b.index>=this._points.item(1).index&&(b.index=this._points.item(1).index-1);D46.prototype.setPoint.call(this,a,b,c);1==a?this._points.item(0).price=this._points.item(1).price+d:this._points.item(1).price=this._points.item(0).price-d};function W65(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W65,W89);
|
|
W65.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size()||2>this.D98.points().size())return a;var b=this.D98.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 RectangleRenderer(c))}var d=this,e=function(b,c){var e={};e.points=(new List).append(b).append(c);e.width=
|
|
d.D99.timeScale().width();e.height=d.D98.priceScale().height();e.color=d.D98.properties().linecolor.value();e.linewidth=d.D98.properties().linewidth.value();e.linestyle=CanvasEx.LINESTYLE_SOLID;e.extendleft=!1;e.extendright=!1;e.leftend=D46.LINEEND_NORMAL;e.rightend=D46.LINEEND_NORMAL;a.append(new 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.D99.timeScale().width();c.height=d.D98.priceScale().height();c.color=d.D98.properties().linecolor.value();c.linewidth=d.D98.properties().linewidth.value();c.linestyle=CanvasEx.LINESTYLE_DASHED;c.extendleft=!1;c.extendright=!1;c.leftend=D46.LINEEND_NORMAL;c.rightend=D46.LINEEND_ARROW;
|
|
a.append(new TrendLineRenderer(c));var c=this.D98.points().item(0).index,h=this.D98.points().item(1).index,e=h-c,c=this.D99.timeScale().indexToUserTime(c),k=this.D99.timeScale().indexToUserTime(h),h="";c&&k&&(c=(k.valueOf()-c.valueOf())/1E3,h=", "+(new TimeSpanFormatter).format(c));c={};c.points=(new List).append(f.add(g).scaled(0.5));c.text=$.t("{0} bars").format(e)+h;c.color=b.textcolor.value();c.font=b.font.value();c.offsetX=0;c.offsetY=0;c.vertAlign="top";c.horzAlign="center";c.backgroundRoundRect=
|
|
0;c.backgroundHorzInflate=0.4*b.fontsize.value();c.backgroundVertInflate=0.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.isAnchorsRequired()&&a.append(this.createLineAnchor({points:this._points}));
|
|
return a};TradingView.LineToolDateRange=function(a,b){this._constructor="LineToolDateRange";var c=b?b:new W51("linetooldaterange");D46.call(this,a,new W65(this,a),c)};inherit(TradingView.LineToolDateRange,D46);TradingView.LineToolDateRange.prototype.pointsCount=function(){return 2};TradingView.LineToolDateRange.prototype.title=function(){return"Date Range"};function D5(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(D5,W89);
|
|
D5.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size()||2>this.D98.points().size())return a;var b=this.D98.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 RectangleRenderer(c))}var d=this,c=function(b,c){var e={};e.points=(new List).append(b).append(c);e.width=
|
|
d.D99.timeScale().width();e.height=d.D98.priceScale().height();e.color=d.D98.properties().linecolor.value();e.linewidth=d.D98.properties().linewidth.value();e.linestyle=CanvasEx.LINESTYLE_SOLID;e.extendleft=!1;e.extendright=!1;e.leftend=D46.LINEEND_NORMAL;e.rightend=D46.LINEEND_NORMAL;a.append(new TrendLineRenderer(e))},e=this._points.item(0),f=this._points.item(1),f=new MathEx.Point(f.x,e.y);c(e,f);e=this._points.item(0);f=this._points.item(1);e=new MathEx.Point(e.x,
|
|
f.y);c(e,f);var e=this._points.item(0),f=this._points.item(1),c=(e.x+f.x)/2,g=new MathEx.Point(c,e.y),h=new MathEx.Point(c,f.y),c={};c.points=(new List).append(g).append(h);c.width=d.D99.timeScale().width();c.height=d.D98.priceScale().height();c.color=d.D98.properties().linecolor.value();c.linewidth=d.D98.properties().linewidth.value();c.linestyle=CanvasEx.LINESTYLE_DASHED;c.extendleft=!1;c.extendright=!1;c.leftend=D46.LINEEND_NORMAL;c.rightend=D46.LINEEND_ARROW;
|
|
a.append(new TrendLineRenderer(c));var g=this.D98.points().item(0).price,h=this.D98.points().item(1).price,c=h-g,k=100*c/g,k=this.D98.priceScale().formatter().format(c)+" ("+Math.round(100*k)/100+"%)",c={};h>g?(g=f.clone(),g.y-=2*b.fontsize.value(),g.x=0.5*(e.x+f.x)):(g=f.clone(),g.x=0.5*(e.x+f.x),g.y+=0.7*b.fontsize.value());c.points=(new List).append(g);c.text=k;c.color=b.textcolor.value();c.font=b.font.value();c.offsetX=0;c.offsetY=0;c.vertAlign="middle";c.horzAlign="center";c.fontsize=
|
|
b.fontsize.value();c.backgroundRoundRect=0;c.backgroundHorzInflate=0.4*b.fontsize.value();c.backgroundVertInflate=0.2*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.isAnchorsRequired()&&a.append(this.createLineAnchor({points:this._points}));
|
|
return a};TradingView.LineToolPriceRange=function(a,b){this._constructor="LineToolPriceRange";var c=b?b:new W51("linetoolpricerange");D46.call(this,a,new D5(this,a),c)};inherit(TradingView.LineToolPriceRange,D46);TradingView.LineToolPriceRange.prototype.pointsCount=function(){return 2};TradingView.LineToolPriceRange.prototype.title=function(){return"Price Range"};function ParallelChannelRenderer(a){this._data=a}
|
|
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]};
|
|
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);if(4==this._data.points.size()){var c=this._data.points.item(2),d=this._data.points.item(3);if(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){var d=Math.max(b[1].x,c[1].x),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=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(0.5),c=this._data.points.item(1).add(this._data.points.item(3)).scaled(0.5),
|
|
c=this.extendPoints(b,c,this._data.width,this._data.height),(b=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)))}}}};
|
|
ParallelChannelRenderer.prototype.hitTest=function(a){if(2>this._data.points.size())return null;if(this._data.floatPoints)var b=this._data.floatPoints.item(0),c=this._data.floatPoints.item(1);else b=this._data.points.item(0),c=this._data.points.item(1);var d=this.extendPoints(b,c,this._data.width,this._data.height),d=MathEx.distanceToSegment(d[0],d[1],a);if(3>=d.distance)return new HitTestResult(HitTestResult.MOVEPOINT);if(this._data.floatPoints)var e=this._data.floatPoints.item(2),f=this._data.floatPoints.item(3);
|
|
else e=this._data.points.item(2),f=this._data.points.item(3);if(4==this._data.points.size()&&!this._data.skipTopLine){if(!e||!f)return null;d=this.extendPoints(e,f,this._data.width,this._data.height);d=MathEx.distanceToSegment(d[0],d[1],a);if(3>=d.distance)return new HitTestResult(HitTestResult.MOVEPOINT);if(this._data.showMidline&&!this._data.skipLines){var d=this._data.points.item(0).add(this._data.points.item(2)).scaled(0.5),g=this._data.points.item(1).add(this._data.points.item(3)).scaled(0.5),
|
|
d=this.extendPoints(d,g,this._data.width,this._data.height),d=MathEx.distanceToSegment(d[0],d[1],a);if(3>=d.distance)return new HitTestResult(HitTestResult.MOVEPOINT)}}return this._data.hittestOnBackground&&this._data.fillBackground&&4==this._data.points.size()&&(b=(new List).append(b).append(c).append(f).append(e),MathEx.isInPolygon(b,a))?new HitTestResult(HitTestResult.MOVEPOINT):null};function W97(a,b){W89.call(this,a,b)}inherit(W97,W89);
|
|
W97.prototype.update=function(){W89.prototype.update.call(this);if(this.D98.priceScale()&&!this.D98.priceScale().isEmpty()&&0!=this.D98.points().size()&&(this.D98._priceOffset||this.D98.calculatePriceDiff(),3===this._points.size()&&this.D98._priceOffset)){var a=this._points.item(0),b=this._points.item(1),c=this.D98._priceOffset+this.D98.points().item(0).price,d=this.D98._priceOffset+this.D98.points().item(1).price;this._p3=
|
|
a.clone();this._p4=b.clone();a=this.D98.priceScale();a.isLog()?(a=0.5*(c+d)-this.D98._priceOffset,c=0.5*(c+d),d=this.D98.priceScale().priceToCoordinate(a),c=this.D98.priceScale().priceToCoordinate(c)-d,this._p3.y+=c,this._p4.y+=c):(a.isPercent()&&(b=this.D98.ownerSource().firstValue(),c=a.priceRange().convertToPercent(c,b),d=a.priceRange().convertToPercent(d,b)),this._p3.y=this.D98.priceScale().priceToCoordinate(c),this._p4.y=this.D98.priceScale().priceToCoordinate(d))}};
|
|
W97.prototype.renderer=function(){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.D98.properties().linecolor.value();a.width=this.D99.timeScale().width();a.height=this.D98.priceScale().height();var b=this.D98.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=TradingView.isMobile.any();if(this.isAnchorsRequired()){b=new CompositeRenderer;b.append(new ParallelChannelRenderer(a));
|
|
a=new List;a.append(this._points.item(0));this._points.item(1)&&a.append(this._points.item(1));this._p3&&(a.append(this._p3.add(this._p4).scaled(0.5)),a.item(2).data=2);var c=3==this._points.size()&&!this._p3;this.D99.lineBeingCreated()!=this.D98||c||a.removeAt(a.size()-1);b.append(this.createLineAnchor({points:a}));return b}return new ParallelChannelRenderer(a)};
|
|
TradingView.LineToolParallelChannel=function(a,b){this._constructor="LineToolParallelChannel";var c=b?b:new W51("linetoolparallelchannel");D46.call(this,a,new W97(this,a),c)};inherit(TradingView.LineToolParallelChannel,D46);TradingView.LineToolParallelChannel.prototype.addPoint=function(a){if(a=D46.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.D99.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=0.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));D46.prototype.setLastPoint.call(this,a);this.calculatePriceDiff()};
|
|
TradingView.LineToolParallelChannel.prototype.restorePoints=function(a,b,c){D46.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));D46.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 D46.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=D46.prototype.state.call(this,a);a.priceOffset=this._priceOffset;return a};function TrendLineStatsRenderer(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 HitTestResult(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]}};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=textX=this._data.points.item(0).x+(this._data.offsetX||0),e=textY=this._data.points.item(0).y+(this._data.offsetY||0),f=this._fontSize,b=this._lineSpacing,g=(f+b)*this._lines.length-b;a.textBaseline="top";a.font=this.fontStyle();var b=[],h;if(this._data.wordWrapWidth){h=this._data.wordWrapWidth;for(var k=0;k<this._lines.length;k++)b.push(this._data.wordWrapWidth)}else for(k=h=0;k<this._lines.length;k++){var l=a.measureText(this._lines[k]).width;b.push(l);h=Math.max(h,l)}if(this._data.backgroundColor||
|
|
this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){var l={top:this._data.paddingTop||0,right:this._data.paddingRight||0,bottom:this._data.paddingBottom||0,left:this._data.paddingLeft||0},m=0,q=0;this._data.backgroundHorzInflate&&(m=this._data.backgroundHorzInflate/2,l.left+=m,l.right+=m,m=-m);this._data.backgroundVertInflate&&(q=this._data.backgroundVertInflate/2,l.top+=q,l.bottom+=q,q=-q);f="number"==typeof this._data.padding?this._data.padding:~~(f/6);for(k in l)l[k]||
|
|
(l[k]=f);g={x:Math.floor(d+m),y:Math.floor(e+q),w:Math.ceil(h+l.left+l.right),h:Math.ceil(g+l.top+l.bottom)};textX+=l.left+m;textY+=l.top+q;if("bottom"==this._data.vertAlign||"middle"==this._data.vertAlign)e="middle"==this._data.vertAlign?e-g.h/2:e-g.h-(g.y-e),textY+=e-g.y,g.y=e;if("right"==this._data.horzAlign||"center"==this._data.horzAlign)d="center"==this._data.horzAlign?d-g.w/2:d-g.w-(g.x-d),textX+=d-g.x,g.x=d,!0!==this._data.doNotAlignText&&("right"==this._data.horzAlign?(a.textAlign="end",
|
|
textX+=h):(a.textAlign="center",textX+=h/2));0!=g.w%2&&g.w++;g.x+=0.5;g.y+=0.5;this._boundingRect=[new MathEx.Point(g.x,g.y),new MathEx.Point(g.x+g.w,g.y+g.h)];this._rect=g;this._padding=l;this._defaultPadding=f}else{if("bottom"==this._data.vertAlign||"middle"==this._data.vertAlign)textY-=Math.round(g*("middle"==this._data.vertAlign?0.5:1));d=textX;if("right"==this._data.horzAlign||"center"==this._data.horzAlign)d-=Math.round(h*("center"==this._data.horzAlign?0.5:1));this._boundingRect=[new MathEx.Point(d,
|
|
textY),new MathEx.Point(d+h,textY+g)]}this._textPoint={x:textX,y:textY};this._textSizeCache&&(this._textSizeCache.widths=b);this._preRendered=!0}};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)}}})();
|
|
TrendLineStatsRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font};
|
|
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();if((this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth)&&this._rect){var d=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-0.5,e=d.y-0.5,b=d.x+d.w+0.5,e,f);a.dashedLineTo(b,e,b,e=d.y+d.h+0.5,f);a.dashedLineTo(b=d.x-0.5,e,d.x+d.w+0.5,e,f);a.dashedLineTo(b,d.y-0.5,b,e,f);a.globalAlpha=
|
|
0.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}};
|
|
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};function TrendLineRenderer(a,b){this._data=a;this._hittest=b?b:new HitTestResult(HitTestResult.MOVEPOINT)}
|
|
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)}};TrendLineRenderer.prototype.lineClipping=function(a,b,c,d){return(a=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};
|
|
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]};
|
|
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()};
|
|
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;if(this._data.floatPoints)var b=this._data.floatPoints.item(0),c=this._data.floatPoints.item(1);else b=this._data.points.item(0),c=this._data.points.item(1);if(this._data.overlayLineEndings)var d=[$.extend(!0,{},b),$.extend(!0,{},c)];
|
|
else this.drawEnds(a,[b,c]);b=this.expandPoints(b,c,this._data.width,this._data.height);(b=this.lineClipping(b[0],b[1],this._data.width,this._data.height))&&0<this._data.linewidth&&CanvasEx.drawLine(a,Math.round(b[0].x),Math.round(b[0].y),Math.round(b[1].x),Math.round(b[1].y));this._data.overlayLineEndings&&this.drawEnds(a,d)}};
|
|
TrendLineRenderer.prototype.drawEnds=function(a,b){var c=b[0],d=b[1];switch(this._data.leftend){case D46.LINEEND_ARROW:this.drawArrow(d,c,a,a.lineWidth);break;case D46.LINEEND_CIRCLE:this.drawCircle(c,a,a.lineWidth,this._data.endstyle)}switch(this._data.rightend){case D46.LINEEND_ARROW:this.drawArrow(c,d,a,a.lineWidth);break;case D46.LINEEND_CIRCLE:this.drawCircle(d,a,a.lineWidth,this._data.endstyle)}};
|
|
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;if(this._data.floatPoints)var c=this._data.floatPoints.item(0),d=this._data.floatPoints.item(1);else c=this._data.points.item(0),d=this._data.points.item(1);c=this.expandPoints(c,d,this._data.width,this._data.height);return MathEx.distanceToSegment(c[0],c[1],a).distance<=b?this._hittest:null};
|
|
function D42(a,b){W89.call(this,a,b);this._label=null;this._rendererCache={}}inherit(D42,W89);
|
|
D42.prototype.update=function(){W89.prototype.update.call(this);this._label=null;if(!(2>this.D98.points().size())){var a=this.D98.points().item(0),b=this.D98.points().item(1),c=[],d,e,f,g,h;if(this.D98.properties().showPriceRange.value()&&this.D98.priceScale()){g=b.price-a.price;d=g/a.price;d=this.D98.priceScale().formatter().format(g)+" ("+(new PercentageFormatter).format(100*d)+")";var k=this.D99.mainSeries().base();k&&(k=Math.round(g*k),d+=
|
|
", "+k);c.push("priceRange")}var k=this.D98.properties().showBarsRange.value(),l=this.D98.properties().showDateTimeRange.value(),m=this.D98.properties().showDistance.value();if(k||l||m){e="";k&&(h=b.index-a.index,e+=$.t("{0} bars").format(h));if(l){var l=this.D99.timeScale().indexToUserTime(a.index),q=this.D99.timeScale().indexToUserTime(b.index);l&&q&&(l=(q.valueOf()-l.valueOf())/1E3,(l=(new TimeSpanFormatter).format(l))&&(e+=k?" ("+l+")":l))}m&&(e&&(e+=", "),"undefined"==typeof g&&
|
|
(g=b.price-a.price),"undefined"==typeof h&&(h=b.index-a.index),g=Math.round(1E5*Math.sqrt(g*g+h*h))/1E5,e+=$.t("distance: {0}").format(g));e&&c.push("barsRange")}if(this.D98.properties().showAngle.value()){var a=this.D98.pointToScreenPoint(a),b=this.D98.pointToScreenPoint(b),n,a=a instanceof Array?a[0]:a instanceof MathEx.Point?a:null,b=b instanceof Array?b[0]:b instanceof MathEx.Point?b:null;a instanceof MathEx.Point&&b instanceof MathEx.Point&&(b=b.substract(a),0<b.length()&&(b=b.normalized(),
|
|
n=Math.acos(b.x),0<b.y&&(n=-n)));"number"!=typeof n||isNaN(n)||(f=Math.round(180*n/Math.PI)+"\u00ba",c.push("angle"))}this._label=[d,e,f].filter(function(a){return a}).join("\n")||null;this._icons=c}};
|
|
D42.prototype.renderer=function(){var a=new CompositeRenderer;if(!this.D98.priceScale())return a;var b={};b.points=this._points;b.floatPoints=this._floatPoints;b.width=this.D99.timeScale().width();b.height=this.D98.priceScale().height();b.color=this.D98.properties().linecolor.value();b.linewidth=this.D98.properties().linewidth.value();b.linestyle=this.D98.properties().linestyle.value();b.extendleft=this.D98.properties().extendLeft.value();b.extendright=this.D98.properties().extendRight.value();
|
|
b.leftend=this.D98.properties().leftEnd.value();b.rightend=this.D98.properties().rightEnd.value();a.append(new TrendLineRenderer(b));var c=this.isAnchorsRequired();if((c||this.D98.properties().alwaysShowStats.value())&&this._label&&2==this._points.size()){var d={points:(new List).append(this._points.item(1)),text:this._label,color:this.D98.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 TrendLineStatsRenderer(d,
|
|
this._rendererCache))}c&&(b=b.points.clone(),this.D99.lineBeingCreated()==this.D98&&b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};TradingView.LineToolTrendLine=function(a,b){this._constructor="LineToolTrendLine";var c=b?b:new W51("linetooltrendline");D46.call(this,a,new D42(this,a),c)};inherit(TradingView.LineToolTrendLine,D46);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.pointsCount=function(){return 2};TradingView.LineToolTrendLine.prototype.title=function(){return"Trend Line"};
|
|
(function(){function a(a,h,k,l,m,q){var n=b;a<k?n|=c:a>m&&(n|=d);h<l?n|=e:h>q&&(n|=f);return n}var b=0,c=1,d=2,e=4,f=8;window.CohenSutherland=function(b,c,k,l,m,q,n,t){for(var u=a(b,c,m,q,n,t),z=a(k,l,m,q,n,t),s=!1,A,B,w,v=0;;){if(1E3<v)throw Error("Cohen - Sutherland algorithm: infinity loop");v++;if(u|z)if(u&z)break;else w=u?u:z,w&f?(A=b+(k-b)*(t-c)/(l-c),B=t):w&e?(A=b+(k-b)*(q-c)/(l-c),B=q):w&d?(B=c+(l-c)*(n-b)/(k-b),A=n):(B=c+(l-c)*(m-b)/(k-b),A=m),w==u?(b=A,c=B,u=a(b,c,m,q,n,t)):(k=A,l=B,z=a(k,
|
|
l,m,q,n,t));else{s=!0;break}}return s?[b,c,k,l]:!1}})();function RectangleRenderer(a){this._data=a}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=generateColor(this._data.backcolor,this._data.transparency),a.fill())}};
|
|
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,d.y),f=MathEx.distanceToSegment(b,d,a);if(3>=f.distance)return new HitTestResult(HitTestResult.MOVEPOINT);f=MathEx.distanceToSegment(d,c,a);if(3>=f.distance)return new HitTestResult(HitTestResult.MOVEPOINT);f=MathEx.distanceToSegment(c,e,a);if(3>=f.distance)return new HitTestResult(HitTestResult.MOVEPOINT);
|
|
f=MathEx.distanceToSegment(e,b,a);return 3>=f.distance||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))?new HitTestResult(HitTestResult.MOVEPOINT):null};function D7(a,b){W89.call(this,a,b)}inherit(D7,W89);
|
|
D7.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.D98.properties().color.value();a.linewidth=this.D98.properties().linewidth.value();a.backcolor=this.D98.properties().backgroundColor.value();a.fillBackground=this.D98.properties().fillBackground.value();a.transparency=this.D98.properties().transparency.value();if(this.isAnchorsRequired()){var b=new CompositeRenderer;b.append(new RectangleRenderer(a));a=a.points.clone();this.D99.lineBeingCreated()==
|
|
this.D98&&a.removeAt(a.size()-1);b.append(this.createLineAnchor({points:a}));return b}return new RectangleRenderer(a)};TradingView.LineToolRectangle=function(a,b){this._constructor="LineToolRectangle";var c=b?b:new W51("linetoolrectangle");D46.call(this,a,new D7(this,a),c)};inherit(TradingView.LineToolRectangle,D46);TradingView.LineToolRectangle.prototype.pointsCount=function(){return 2};TradingView.LineToolRectangle.prototype.title=function(){return"Rectangle"};function EllipseRenderer(a){this._data=a;this._data.angleFrom=0;this._data.angleTo=2*Math.PI;this._data.clockwise=!1}
|
|
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(0.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,0.5*c,this._data.angleFrom,this._data.angleTo,this._data.clockwise);a.restore();a.stroke();this._data.fillBackground&&(a.fillStyle=generateColor(this._data.backcolor,this._data.transparency),a.fill())}}}};EllipseRenderer.prototype._additionalPointTest=function(a,b){return!0};
|
|
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(0.5),b=new MathEx.Point(-e.y,e.x),b=b.normalized();c.add(b.scaled(d));c.add(b.scaled(-d));var b=e.length(),f=e.y/b,e=Math.acos(e.x/b);0>f&&(e=-e);f=MathEx.Matrix.translate(-c.x,-c.y);a=f.mult(a);c=f.mult(this._data.points.item(2));f=MathEx.Matrix.rotate(-e);
|
|
a=f.mult(a);c=f.mult(c);f=MathEx.Matrix.scale(1,b/(2*d));a=f.mult(a);c=f.mult(c);d=a.length();if(!this._additionalPointTest(a,c))return null;if(this._data.fillBackground&&!this._data.noHitTestOnBackground){if(d<=0.5*b)return new HitTestResult(HitTestResult.MOVEPOINT)}else if(3>=Math.abs(d-0.5*b))return new HitTestResult(HitTestResult.MOVEPOINT);return null};function W68(a,b){W89.call(this,a,b)}inherit(W68,W89);
|
|
W68.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b={};b.points=this._points;b.color=this.D98.properties().color.value();b.linewidth=this.D98.properties().linewidth.value();b.backcolor=this.D98.properties().backgroundColor.value();b.fillBackground=this.D98.properties().fillBackground.value();b.transparency=this.D98.properties().transparency.value();a.append(new 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(0.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;f=new List;f.append(c).append(d).append(b).append(e);a.append(this.createLineAnchor({points:f}))}return a};
|
|
TradingView.LineToolEllipse=function(a,b){this._constructor="LineToolEllipse";var c=b?b:new W51("linetoolellipse");D46.call(this,a,new W68(this,a),c);this.version=TradingView.LineToolEllipse.version};inherit(TradingView.LineToolEllipse,D46);
|
|
TradingView.LineToolEllipse.prototype.startChanging=function(a,b){D46.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(0.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(0.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(0.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(0.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=0.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=0.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))};function HorzLineRenderer(a){this._data=a}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)}};
|
|
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 HitTestResult(this._data.hitTestResult):null};function W84(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W84,W89);
|
|
W84.prototype.renderer=function(){var a=new CompositeRenderer,b={};b.points=this._points;b.color=this.D98.properties().linecolor.value();b.linewidth=this.D98.properties().linewidth.value();b.linestyle=this.D98.properties().linestyle.value();b.hitTestResult=HitTestResult.MOVEPOINT;var c=this.D98.properties();a.append(new HorzLineRenderer(b));if(this.D98.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.D99.timeScale().width(),h=-5):f.x=this.D99.timeScale().width()/2;"middle"==d?g=-this.D98.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.D98.properties().bold.value(),italic:this.D98.properties().italic.value(),fontsize:this.D98.properties().fontsize.value()};
|
|
a.append(new TextRenderer(c,this._rendererCache))}this.isAnchorsRequired()&&(a.append(new HorzLineRenderer(b)),b=new List,b.append(new MathEx.Point(this.D99.timeScale().width()/2,this._points.item(0).y)),a.append(this.createLineAnchor({points:b,hittestResult:HitTestResult.MOVEPOINT})));return a};function LineToolHorzLinePriceAxisView(a,b){this.D98=a;this.D99=b;this._text="";this._coordinate=0;this._background="black";this._textHeight=14}inherit(LineToolHorzLinePriceAxisView,PriceAxisView);
|
|
LineToolHorzLinePriceAxisView.prototype.update=function(){if(0!==this.D98.points().size()&&this.D98.priceScale()&&!this.D98.priceScale().isEmpty()){this._background=this.D98.properties().linecolor.value();var a=this.D98.points().item(0).price;if(this.D98.priceScale().isPercent()){var b=this.D98.ownerSource().firstValue();if(null===b)return;a=this.D98.priceScale().priceRange().convertToPercent(a,b)}this._coordinate=this.D98.priceScale().priceToCoordinate(a);this._textHeight=
|
|
this.D98.priceScale().m_markBuilder.fontHeight();this.D98.priceScale().formatter()&&(this._text=this.D98.priceScale().formatter().format(a))}};LineToolHorzLinePriceAxisView.prototype.renderer=function(){var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:this._textHeight,visible:!0};return new PriceAxisViewRenderer(a)};
|
|
TradingView.LineToolHorzLine=function(a,b){this._constructor="LineToolHorzLine";var c=b?b:new W51("linetoolhorzline");D46.call(this,a,new W84(this,a),c);this._priceAxisView=new LineToolHorzLinePriceAxisView(this,a)};inherit(TradingView.LineToolHorzLine,D46);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()?this.D99.paneForSource(this)===a&&b===this.priceScale()&&this.properties().showPrice.value()?(new List).append(this._priceAxisView):null:null};TradingView.LineToolHorzLine.prototype.updateAllViews=function(){D46.prototype.updateAllViews.call(this);this._priceAxisView.update()};function HorzRayRenderer(a){this._data=a}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)};
|
|
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 HitTestResult(this._data.hitTestResult):null};function W85(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W85,W89);
|
|
W85.prototype.renderer=function(){var a=new CompositeRenderer,b={};b.points=this._points;b.color=this.D98.properties().linecolor.value();b.linewidth=this.D98.properties().linewidth.value();b.linestyle=this.D98.properties().linestyle.value();b.hitTestResult=HitTestResult.MOVEPOINT;var c=this.D98.properties();a.append(new HorzRayRenderer(b));if(this.D98.properties().showLabel.value()&&1==this._points.size()){var b=c.vertLabelsAlign.value(),d=c.horzLabelsAlign.value(),
|
|
e=this._points.item(0).clone(),f=0,g=0;"right"==d?(e.x=this.D99.timeScale().width(),g=-5):"center"==d&&(e.x=(e.x+this.D99.timeScale().width())/2);"middle"==b?f=-this.D98.properties().fontsize.value()/6:"bottom"==b&&(f=-4);c={points:(new List).append(e),text:c.text.value(),color:c.textcolor.value(),vertAlign:b,horzAlign:d,font:c.font.value(),offsetX:g,offsetY:f,bold:this.D98.properties().bold.value(),italic:this.D98.properties().italic.value(),fontsize:this.D98.properties().fontsize.value()};
|
|
a.append(new TextRenderer(c,this._rendererCache))}this.isAnchorsRequired()&&(c=new List,c.append(this._points.item(0)),a.append(this.createLineAnchor({points:c})));return a};function LineToolHorzRayPriceAxisView(a,b){this.D98=a;this.D99=b;this._text="";this._coordinate=0;this._background="black";this._textHeight=14}inherit(LineToolHorzRayPriceAxisView,PriceAxisView);
|
|
LineToolHorzRayPriceAxisView.prototype.update=function(){0!==this.D98.points().size()&&this.D98.priceScale()&&!this.D98.priceScale().isEmpty()&&(this._background=this.D98.properties().linecolor.value(),this._coordinate=this.D98.priceScale().priceToCoordinate(this.D98.points().item(0).price),this._textHeight=this.D98.priceScale().m_markBuilder.fontHeight(),this._text=this.D98.priceScale().formatter().format(this.D98.points().item(0).price))};
|
|
LineToolHorzRayPriceAxisView.prototype.renderer=function(){var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:this._textHeight,visible:!0};return new PriceAxisViewRenderer(a)};TradingView.LineToolHorzRay=function(a,b){this._constructor="LineToolHorzRay";var c=b?b:new W51("linetoolhorzray");D46.call(this,a,new W85(this,a),c);this._priceAxisView=new LineToolHorzRayPriceAxisView(this,a)};
|
|
inherit(TradingView.LineToolHorzRay,D46);TradingView.LineToolHorzRay.prototype.pointsCount=function(){return 1};TradingView.LineToolHorzRay.prototype.title=function(){return"Horizontal Ray"};TradingView.LineToolHorzRay.prototype.priceAxisViews=function(a,b){return this.symbol()!==this.D99.mainSeries().symbol()?null:this.D99.paneForSource(this)===a&&b===this.priceScale()&&this.properties().showPrice.value()?(new List).append(this._priceAxisView):null};
|
|
TradingView.LineToolHorzRay.prototype.updateAllViews=function(){D46.prototype.updateAllViews.call(this);this._priceAxisView.update()};function VertLineRenderer(a,b){this._data=a;this._hittest=b}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.width;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)}};
|
|
VertLineRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._hittest||new HitTestResult(HitTestResult.MOVEPOINT);return 3>=Math.abs(a.x-this._data.points.item(0).x)?b:null};function D44(a,b){W89.call(this,a,b)}inherit(D44,W89);
|
|
D44.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.D98.properties().linecolor.value();a.linewidth=this.D98.properties().linewidth.value();a.linestyle=this.D98.properties().linestyle.value();if(this.isAnchorsRequired()){var b=new CompositeRenderer;b.append(new VertLineRenderer(a));a=new List;a.append(new MathEx.Point(this._points.item(0).x,this.D98.priceScale().height()/2));b.append(this.createLineAnchor({points:a,hittestResult:HitTestResult.MOVEPOINT}));
|
|
return b}return new VertLineRenderer(a)};function LineToolVertLineTimeAxisView(a,b){TimeAxisView.call(this);this.D98=a;this.D99=b}inherit(LineToolVertLineTimeAxisView,TimeAxisView);
|
|
LineToolVertLineTimeAxisView.prototype.update=function(){if(!this.D99.timeScale().isEmpty()&&0!==this.D98.points().size()){this._text="";this._background=this.D98.properties().linecolor.value();var a=this.D98.points().item(0).index;this._coordinate=this.D99.timeScale().indexToCoordinate(a);if(a=this.D99.timeScale().indexToUserTime(a))this._text=(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(a)}};
|
|
LineToolVertLineTimeAxisView.prototype.renderer=function(){var a={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background,textHeight:18};return new TimeAxisViewRenderer(a)};TradingView.LineToolVertLine=function(a,b){this._constructor="LineToolVertLine";var c=b?b:new W51("linetoolvertline");D46.call(this,a,new D44(this,a),c);this._timeAxisView=new LineToolVertLineTimeAxisView(this,a)};inherit(TradingView.LineToolVertLine,D46);
|
|
TradingView.LineToolVertLine.prototype.pointsCount=function(){return 1};TradingView.LineToolVertLine.prototype.title=function(){return"Vertical Line"};TradingView.LineToolVertLine.prototype.timeAxisViews=function(){return this.symbol()!==this.D99.mainSeries().symbol()?null:this.properties().showTime.value()?(new List).append(this._timeAxisView):null};TradingView.LineToolVertLine.prototype.updateAllViews=function(){D46.prototype.updateAllViews.call(this);this._timeAxisView.update()};function ChannelRenderer(a){this._data=a}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]};
|
|
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=generateColor(this._data.color,this._data.transparency);a.fill()};
|
|
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(new List(d),a)?
|
|
new HitTestResult(HitTestResult.MOVEPOINT):null};function D0(a,b){W89.call(this,a,b)}inherit(D0,W89);
|
|
D0.prototype.update=function(){W89.prototype.update.call(this);0!==this._points.size()&&(3===this._points.size()?this._medianPoint=this._points.item(1).add(this._points.item(2)).scaled(0.5):2===this._points.size()?this._medianPoint=this._points.item(1):this._medianPoint=this._points.item(0),this._medianPoint.data=3)};
|
|
D0.prototype.renderer=function(){var a=new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,
|
|
rightend:D46.LINEEND_NORMAL};a.append(new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,
|
|
rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));for(var b=this._points.item(2).substract(this._points.item(1)).scaled(0.5),c=this._medianPoint.substract(this._points.item(0)),d=0,e=this.D98.properties().fillBackground.value(),f=this.D98.properties().transparency.value(),g=0;8>=g;g++){var h="level"+g,h=this.D98.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()),
|
|
q=m.add(c);if(e){var n={};n.width=this.D99.timeScale().width();n.p1=k;n.p2=l;n.p3=this._medianPoint.addScaled(b,d);n.p4=n.p3.add(c);n.color=h.color.value();n.transparency=f;n.hittestOnBackground=TradingView.isMobile.any();a.append(new ChannelRenderer(n));n={};n.width=this.D99.timeScale().width();n.p1=m;n.p2=q;n.p3=this._medianPoint.addScaled(b,-d);n.p4=n.p3.add(c);n.color=h.color.value();n.transparency=f;n.hittestOnBackground=TradingView.isMobile.any();a.append(new ChannelRenderer(n))}d=h.coeff.value();
|
|
l={points:(new List).append(k).append(l),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:h.color.value(),linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};k=new HitTestResult(HitTestResult.MOVEPOINT,null,g);a.append(new TrendLineRenderer(l,k));h={points:(new List).append(m).append(q),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),
|
|
color:h.color.value(),linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};k=new HitTestResult(HitTestResult.MOVEPOINT,null,g);a.append(new TrendLineRenderer(h,k))}}this.addAnchors(a);return a};function D11(a,b){D0.call(this,a,b)}inherit(D11,D0);
|
|
D11.prototype.renderer=function(){var a=new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,
|
|
rightend:D46.LINEEND_NORMAL};a.append(new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),extendleft:!1,extendright:!0,
|
|
leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),extendleft:!1,
|
|
extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(c));for(var c=this._points.item(2).substract(this._points.item(1)).scaled(0.5),d=this._medianPoint.substract(this._modifiedBase),e=0,f=this.D98.properties().fillBackground.value(),g=this.D98.properties().transparency.value(),h=0;8>=h;h++){var k="level"+h,k=this.D98.properties()[k];if(k.visible.value()){var l=this._medianPoint.addScaled(c,k.coeff.value()),m=l.add(d),
|
|
q=this._medianPoint.addScaled(c,-k.coeff.value()),n=q.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.transparency=g,a.append(new ChannelRenderer(b)),b={},b.p1=q,b.p2=n,b.p3=this._medianPoint.addScaled(c,-e),b.p4=b.p3.add(d),b.color=k.color.value(),b.transparency=g,a.append(new ChannelRenderer(b)));e=k.coeff.value();l={points:(new List).append(l).append(m),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),
|
|
color:k.color.value(),linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};b=new HitTestResult(HitTestResult.MOVEPOINT,null,h);a.append(new TrendLineRenderer(l,b));k={points:(new List).append(q).append(n),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:k.color.value(),linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,
|
|
leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};b=new HitTestResult(HitTestResult.MOVEPOINT,null,h);a.append(new TrendLineRenderer(k,b))}}this.addAnchors(a);return a};D11.prototype.update=function(){D0.prototype.update.call(this);1<this._points.size()&&(this._modifiedBase=this._points.item(0).add(this._points.item(1)).scaled(0.5))};function D10(a,b){D11.call(this,a,b)}
|
|
inherit(D10,D11);D10.prototype.update=function(){D0.prototype.update.call(this);if(2<this._points.size()){var a=this._points.item(0).x,b=0.5*(this._points.item(0).y+this._points.item(1).y);this._modifiedBase=new MathEx.Point(a,b)}};function W87(a,b){D0.call(this,a,b)}inherit(W87,D0);
|
|
W87.prototype.update=function(){D0.prototype.update.call(this);1<this._points.size()&&(this._modifiedBase=this._points.item(0).add(this._points.item(1)).scaled(0.5))};
|
|
W87.prototype.renderer=function(){var a=new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),
|
|
extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(b))}var c={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),extendleft:!1,extendright:!1,
|
|
leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),extendleft:!1,
|
|
extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));var b=this._points.item(2).substract(this._points.item(1)).scaled(0.5),d=this._points.item(2).substract(this._modifiedBase),e=0,f=this.D98.properties().fillBackground.value(),g=this.D98.properties().transparency.value(),h={points:(new List).append(this._medianPoint).append(this._medianPoint.add(d)),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),
|
|
color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(h));for(h=0;8>=h;h++){var k="level"+h,k=this.D98.properties()[k];if(k.visible.value()){var l=this._medianPoint.addScaled(b,k.coeff.value()),m=l.add(d),q=this._medianPoint.addScaled(b,-k.coeff.value()),
|
|
n=q.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.transparency=g,a.append(new ChannelRenderer(c)),c={},c.p1=q,c.p2=n,c.p3=this._medianPoint.addScaled(b,-e),c.p4=c.p3.add(d),c.color=k.color.value(),c.transparency=g,a.append(new ChannelRenderer(c)));e=k.coeff.value();l={points:(new List).append(l).append(m),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:k.color.value(),linewidth:k.linewidth.value(),
|
|
linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};c=new HitTestResult(HitTestResult.MOVEPOINT,null,h);a.append(new TrendLineRenderer(l,c));k={points:(new List).append(q).append(n),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:k.color.value(),linewidth:k.linewidth.value(),linestyle:k.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};
|
|
c=new HitTestResult(HitTestResult.MOVEPOINT,null,h);a.append(new TrendLineRenderer(k,c))}}this.addAnchors(a);return a};TradingView.LineToolPitchfork=function(a,b){this._constructor="LineToolPitchfork";var c=b?b:new W51("linetoolpitchfork");D46.call(this,a,new D0(this,a),c);this.Z1.style.listeners().subscribe(this,TradingView.LineToolPitchfork.prototype._recreatePaneView);this._recreatePaneView()};inherit(TradingView.LineToolPitchfork,D46);
|
|
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 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.D99.updateSource(a)});a.push(d)}return[a[0],a[3],a[1],a[2]]};
|
|
TradingView.LineToolPitchfork.prototype._recreatePaneView=function(){this.Z1.style.value()==TradingView.LineToolPitchfork.STYLE_ORIGINAL?this._paneViews=[new D0(this,this.D99)]:this.Z1.style.value()==TradingView.LineToolPitchfork.STYLE_SCHIFF?this._paneViews=[new D11(this,this.D99)]:this.Z1.style.value()==TradingView.LineToolPitchfork.STYLE_SCHIFF2?this._paneViews=[new D10(this,this.D99)]:this.Z1.style.value()==
|
|
TradingView.LineToolPitchfork.STYLE_INSIDE&&(this._paneViews=[new W87(this,this.D99)])};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")};function W99(a,b){W89.call(this,a,b)}inherit(W99,W89);W99.prototype.update=function(){W89.prototype.update.call(this);0!==this._points.size()&&(3===this._points.size()?this._medianPoint=this._points.item(1).add(this._points.item(2)).scaled(0.5):2===this._points.size()?this._medianPoint=this._points.item(1):this._medianPoint=this._points.item(0),this._medianPoint.data=3)};
|
|
W99.prototype.renderer=function(){var a=new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,
|
|
rightend:D46.LINEEND_NORMAL};a.append(new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this.D98.properties().median.color.value(),linewidth:this.D98.properties().median.linewidth.value(),linestyle:this.D98.properties().median.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,
|
|
rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(b));for(var b=0,c=this._points.item(2).substract(this._points.item(1)).scaled(0.5),d=this.D98.properties().fillBackground.value(),e=this.D98.properties().transparency.value(),f=0;8>=f;f++){var g="level"+f,g=this.D98.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.D99.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=TradingView.isMobile.any();a.append(new ChannelRenderer(l));l={};l.width=this.D99.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=TradingView.isMobile.any();a.append(new ChannelRenderer(l))}b=g.coeff.value();l={points:(new List).append(this._points.item(0)).append(h),
|
|
width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:g.color.value(),linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};h=new HitTestResult(HitTestResult.MOVEPOINT,null,f);a.append(new TrendLineRenderer(l,h));g={points:(new List).append(this._points.item(0)).append(k),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:g.color.value(),
|
|
linewidth:g.linewidth.value(),linestyle:g.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};h=new HitTestResult(HitTestResult.MOVEPOINT,null,f);a.append(new TrendLineRenderer(g,h))}}this.addAnchors(a);return a};TradingView.LineToolPitchfan=function(a,b){this._constructor="LineToolPitchfan";var c=b?b:new W51("linetoolpitchfan");D46.call(this,a,new W99(this,a),c)};
|
|
inherit(TradingView.LineToolPitchfan,D46);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 W51("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 W51("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 W51("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 HitTestResult(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+0.5,c+0.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)}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);g=Math.floor(g-l);h=Math.floor(c-d);f=Math.ceil(f+2*l);k=Math.ceil(k+2*l);0!=f%2&&f++;this._data.backgroundVertInflate&&(c+=this._data.backgroundVertInflate);if(this._data.backgroundRoundRect){if(a.roundRect(g,h,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 m=~~Math.max(d/12,1);a.strokeStyle=this._data.borderColor;a.lineWidth=m;a.stroke()}}else if(this._data.backgroundColor&&(a.fillStyle=this._data.backgroundColor,a.globalAlpha=this._data.backgroundTransparency,a.fillRect(g,h,f,k),a.globalAlpha=1),this._data.borderColor)m=~~Math.max(d/12,1),a.strokeStyle=this._data.borderColor,a.lineWidth=m,a.strokeRect(g-m/2,h-m/2,f+m,k+m);
|
|
else if(this._data.highlightBorder){a.strokeStyle=this._data.color;a.lineWidth=1;a.beginPath();var q=[3,1];a.dashedLineTo(g-0.5,m=h-0.5,l=g+f+0.5,m,q);a.dashedLineTo(l,m,l,m=h+k+0.5,q);a.dashedLineTo(l=g-0.5,m,g+f+0.5,m,q);a.dashedLineTo(l,h-0.5,l,m,q);a.globalAlpha=0.5;a.stroke();a.globalAlpha=1}}a.fillStyle=this._data.color;for(g=0;g<this._lines.length;g++)a.fillText(this._lines[g],b,c),c+=d;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};function D38(a,b,c,d,e,f){W89.call(this,a,b);this._offsetX=c;this._offsetY=d;this._vertAlign=e;this._horzAlign=f;this._rendererCache={};this._renderer=null}
|
|
inherit(D38,W89);D38.prototype.update=function(){this._renderer=null;W89.prototype.update.call(this)};
|
|
D38.prototype.renderer=function(){if(this._renderer)return this._renderer;var a=this.D98.priceScale();if(!a||a.isEmpty())return this._renderer=new CompositeRenderer;var b={},c=this.D98.properties(),d=c.locked&&c.locked.value();b.points=d?this.D98.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.D99.selectedSource()===this.D98;
|
|
d||!c.fixedSize||c.fixedSize.value()||(b.scaleX=this.D98.D99.timeScale().barSpacing()/this.D98._barSpacing,c=a.height()/a.priceRange().length(),this.D98._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.D98._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.D98._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 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:(new List).append(b)}))),this._renderer=a):this._renderer=c;return this._renderer};
|
|
TradingView.LineToolText=function(a,b){this._constructor="LineToolText";var c=b?b:new W51("linetooltext");D46.call(this,a,new D38(this,a),c);this._timeScale=a.timeScale();this._barSpacing=a.timeScale().barSpacing()};inherit(TradingView.LineToolText,D46);TradingView.LineToolText.MIN_WIDTH=100;
|
|
TradingView.LineToolText.prototype.setPoint=function(a,b){var c=this.properties();if(0===a&&c.wordWrapWidth&&c.wordWrapWidth.value()){var 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.D99.timeScale().barSpacing();this._priceDencity=this.priceScale().height()/this.priceScale().priceRange().length();this.updateAllViews();this.D99.updateSource(this)};TradingView.LineToolText.prototype.restoreTemplate=function(a){delete a.locked;delete a.text;D46.prototype.restoreTemplate.call(this,a)};
|
|
TradingView.LineToolTextAbsolute=function(a,b){var c=b?b:new W51("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=D46.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"));D46.call(this,a,new W96(this,a,this.image,20,20,-11,0),c);this._paneViews[0].setAnchors(new MathEx.Point(0,0))};inherit(TradingView.LineToolThumbUp,D46);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 W51("linetoolthumbdown");D46.call(this,a,new W96(this,a,this.image,20,20,-6,-18),c);this._paneViews[0].setAnchors(new MathEx.Point(0,0))};inherit(TradingView.LineToolThumbDown,D46);
|
|
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)))};function BalloonRenderer(a,b){this._measureCache=b;this._data=a}
|
|
BalloonRenderer.prototype.draw=function(a){if(0!==this._data.points.size()){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.item(0).x-(c.left+20),e=this._data.points.item(0).y-39;this._measureCache&&$.extend(this._measureCache,{innerWidth:b,innerHeight:30,padding:c});a.translate(0.5+d,0.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=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)}};
|
|
BalloonRenderer.prototype.hitTest=function(a){if(0===this._data.points.size()||!this._measureCache.padding)return null;var b=this._data.points.item(0).x-(this._measureCache.padding.left+20),c=this._data.points.item(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 HitTestResult(HitTestResult.MOVEPOINT):null};
|
|
function W55(a,b){W89.call(this,a,b);this._image=TradingView.getImage("balloon",TradingView.wrapUrl("/static/images/balloon.png"));$(this._image).load(function(){b.updateSource(a)});this._rendererCache={}}inherit(W55,W89);
|
|
W55.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.D98.properties().color.value();a.borderColor=this.D98.properties().borderColor.value();a.backgroundColor=this.D98.properties().backgroundColor.value();a.transparency=this.D98.properties().transparency.value();a.fontWeight=this.D98.properties().fontWeight.value();a.fontSize=this.D98.properties().fontsize.value();a.fontFamily=this.D98.properties().font.value();a.label=this.D98.properties().text.value();
|
|
a.image=this._image;if(this.isAnchorsRequired()&&1==a.points.size()){var b=new CompositeRenderer;b.append(new BalloonRenderer(a,this._rendererCache));b.append(new SelectionRenderer({points:a.points}));return b}return new BalloonRenderer(a,this._rendererCache)};TradingView.LineToolBalloon=function(a,b){this._constructor="LineToolBalloon";var c=b?b:new W51("linetoolballoon");D46.call(this,a,new W55(this,a),c)};inherit(TradingView.LineToolBalloon,D46);
|
|
TradingView.LineToolBalloon.prototype.pointsCount=function(){return 1};TradingView.LineToolBalloon.prototype.title=function(){return"Balloon"};function CalloutRenderer(a,b){this._data=a;a.lines=this.wordWrap(a.text,a.wordWrapWidth);this._textSizeCache=b}CalloutRenderer.ROUND_RADIUS=8;CalloutRenderer.TEXT_MARGINS=2;
|
|
(function(){var a;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}})();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 HitTestResult(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 HitTestResult(HitTestResult.MOVEPOINT):null};
|
|
CalloutRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font};
|
|
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=CalloutRenderer.ROUND_RADIUS,g=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,q=0,e=e+2*g>2*f,d=d+2*g>2*f;b.x>l+h?q=20:b.x>l&&(q=10);b.y>m+k?q+=2:b.y>m&&(q+=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==q&&(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==q?(a.lineTo(b.x,b.y),a.lineTo(h,f)):a.arcTo(h,0,h,
|
|
f,f);21==q&&(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==q?(a.lineTo(b.x,b.y),a.lineTo(h-f,k)):a.arcTo(h,k,h-f,k,f);12==q&&(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==q?(a.lineTo(b.x,b.y),a.lineTo(0,k-f)):a.arcTo(0,k,0,k-f,f);1==q&&(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==q?(a.lineTo(b.x,b.y),a.lineTo(f,0)):a.arcTo(0,0,f,0,f);a.stroke();a.fillStyle=
|
|
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()}};function W61(a,b){W89.call(this,a,b);this._textSizeCache={}}inherit(W61,W89);W61.prototype.update=function(){W89.prototype.update.call(this);this.D98._calculatePoint2()};
|
|
W61.prototype.renderer=function(){if(!this._points.item(0))return new CompositeRenderer;if(!(2>this._points.size(0))){var a=this.D98.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.D98._barOffset*this.D99.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 CalloutRenderer(b,this._textSizeCache);if(this.isAnchorsRequired()){a=new 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}));b.wordWrapWidth&&(b=new MathEx.Point(c.x+
|
|
(b.wordWrapWidth>>1)+CalloutRenderer.ROUND_RADIUS+CalloutRenderer.TEXT_MARGINS,c.y),b.data=1,a.append(this.createLineAnchor({points:(new List).append(b)})));return a}return c}};TradingView.LineToolCallout=function(a,b){this._constructor="LineToolCallout";var c=b?b:new W51("linetoolcallout");D46.call(this,a,new W61(this,a),c);this._barOffset=0;this._timeScale=a.timeScale()};inherit(TradingView.LineToolCallout,D46);
|
|
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=D46.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){D46.prototype.setLastPoint.call(this,a);2==this.points().size()&&this._calculateBarOffset()};
|
|
TradingView.LineToolCallout.prototype.setPoint=function(a,b){switch(a){case 0:D46.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)-
|
|
CalloutRenderer.ROUND_RADIUS-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){D46.prototype.move.call(this,a);this._calculateBarOffset()};TradingView.LineToolCallout.prototype.state=function(a){a=D46.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.D99.lineBeingEdited()!=this&&this.D99.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})}};function TriangleRenderer(a){this._data=a}
|
|
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=generateColor(this._data.backcolor,this._data.transparency),a.fill());
|
|
a.stroke()}};
|
|
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),e=MathEx.distanceToSegment(b,c,a);if(3>=e.distance)return new HitTestResult(HitTestResult.MOVEPOINT);e=MathEx.distanceToSegment(c,d,a);if(3>=e.distance)return new HitTestResult(HitTestResult.MOVEPOINT);e=MathEx.distanceToSegment(d,b,a);return 3>=e.distance||this._data.fillBackground&&MathEx.pointInTriangle(b,c,d,a)?new HitTestResult(HitTestResult.MOVEPOINT):
|
|
null};function D43(a,b){W89.call(this,a,b)}inherit(D43,W89);
|
|
D43.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.D98.properties().color.value();a.linewidth=this.D98.properties().linewidth.value();a.backcolor=this.D98.properties().backgroundColor.value();a.fillBackground=this.D98.properties().fillBackground.value();a.transparency=this.D98.properties().transparency.value();if(this.isAnchorsRequired()){var b=new CompositeRenderer;b.append(new TriangleRenderer(a));a=a.points.clone();this.D99.lineBeingCreated()==
|
|
this.D98&&a.removeAt(a.size()-1);b.append(this.createLineAnchor({points:a}));return b}return new TriangleRenderer(a)};TradingView.LineToolTriangle=function(a,b){this._constructor="LineToolTriangle";var c=b?b:new W51("linetooltriangle");D46.call(this,a,new D43(this,a),c)};inherit(TradingView.LineToolTriangle,D46);TradingView.LineToolTriangle.prototype.pointsCount=function(){return 3};TradingView.LineToolTriangle.prototype.title=function(){return"Triangle"};function ArcRenderer(a){this._data=a;this._data.angleFrom=0;this._data.angleTo=Math.PI;this._data.clockwise=!1}inherit(ArcRenderer,EllipseRenderer);ArcRenderer.prototype._additionalPointTest=function(a,b){return 0<=a.y*b.y};
|
|
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(0.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(0.5*c,c*Math.sqrt(3)/2,c,-2*Math.PI/3,-Math.PI/3,!1):a.arc(0.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=generateColor(this._data.backcolor,this._data.transparency),a.fill())}}}};function W53(a,b){W89.call(this,a,b)}inherit(W53,W89);
|
|
W53.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.D98.properties().color.value();a.linewidth=this.D98.properties().linewidth.value();a.backcolor=this.D98.properties().backgroundColor.value();a.fillBackground=this.D98.properties().fillBackground.value();a.transparency=this.D98.properties().transparency.value();if(this.isAnchorsRequired()){var b=new CompositeRenderer;b.append(new 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(0.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}));return b}return new ArcRenderer(a)};TradingView.LineToolArc=function(a,b){this._constructor="LineToolArc";var c=b?b:new W51("linetoolarc");D46.call(this,a,new W53(this,a),c);this.version=TradingView.LineToolArc.version};inherit(TradingView.LineToolArc,D46);
|
|
TradingView.LineToolArc.prototype.startChanging=function(a,b){D46.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.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(0.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(0.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(0.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 W51("linetoolarrow");TradingView.LineToolTrendLine.call(this,a,c)};inherit(TradingView.LineToolArrow,TradingView.LineToolTrendLine);TradingView.LineToolArrow.prototype.title=function(){return"Arrow"};function W60(a,b){W89.call(this,a,b);this._invalidated=!0;this.D99=b;this.D98=a}inherit(W60,W89);W60.prototype.update=function(){this._invalidated=!0};W60.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(0.5/b)}c.push(a[a.length-1]);return c};
|
|
W60.prototype._updateInternal=function(){W89.prototype.update.call(this);var a=Math.max(1,this.D98.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)}};
|
|
W60.prototype.renderer=function(){this._invalidated&&(this._updateInternal(),this._invalidated=!1);var a={},b=this.D98.properties();a.points=this._points;a.color=b.linecolor.value();a.linewidth=b.linewidth.value();a.linestyle=b.linestyle.value();a.skipClosePath=!0;b.fillBackground.value()&&this.D99.lineBeingCreated()!==this.D98&&(a.filled=!0,a.fillBackground=!0,a.backcolor=b.backgroundColor.value(),a.transparency=b.transparency.value());if(this.isAnchorsRequired()&&this.D98.finished()){b=
|
|
new CompositeRenderer;b.append(new PoligonRenderer(a));if(0<a.points.size()){var c=new List;c.append(a.points.item(0));c.append(a.points.item(a.points.size()-1));b.append(new SelectionRenderer({points:c}))}return b}return new PoligonRenderer(a)};TradingView.LineToolBrush=function(a,b){this._constructor="LineToolBrush";var c=b?b:new W51("linetoolbrush");D46.call(this,a,new W60(this,a),c);this._finished=!1};inherit(TradingView.LineToolBrush,D46);
|
|
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}D46.prototype.addPoint.call(this,a);return this._finished};TradingView.LineToolBrush.prototype.restorePoints=function(a,b,c){D46.prototype.restorePoints.call(this,a,b,c);this._finished=!0};TradingView.LineToolRay=function(a,b){this._constructor="LineToolRay";var c=b?b:new W51("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 W51("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 W51("linetoolarrowmark");D46.call(this,a,new W96(this,a,this.image,this.width,this.height,this.offsetX,this.offsetY),c)};inherit(TradingView.LineToolArrowMark,D46);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=D46.prototype.paneViews.call(this,a);null!==a&&this._textPaneView&&a.append(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 D38(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 D38(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 D38(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 D38(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 W51("linetoolflagmark");D46.call(this,a,new W96(this,a,this.image,25,25,-8,-21),c);this._paneViews[0].setAnchors(new MathEx.Point(0,0))};inherit(TradingView.LineToolFlagMark,D46);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)))};function NoteRendererSource(){}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};
|
|
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+0.5);0==this._translate.x%1&&(this._translate.x+=0.5);var d=this._sourceCanvas.getContext("2d"),e=0.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()};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)};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)};
|
|
function NoteRenderer(a,b){this.D98=a;this._data=b}NoteRenderer.prototype.draw=function(a){this.D98.drawOn(a);this._data.tooltipVisible&&this.drawTooltipOn(a)};
|
|
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=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(i=0;i<b.length;i++)a.fillText(b[i].replace(/^\s+/,""),c,h),h+=this._data.fontSize+d;a.restore()};
|
|
NoteRenderer.prototype.hitTest=function(a){if(this.D98.hasPoint(a))return new HitTestResult(HitTestResult.MOVEPOINT)};function NotePaneView(a,b){W89.call(this,a,b);this._rendererSource=new NoteRendererSource}inherit(NotePaneView,W89);
|
|
NotePaneView.prototype.renderer=function(){var a=new CompositeRenderer,b=this.D98.properties(),c=b.locked&&b.locked.value()?this.D98.fixedPoints():this._points;if(1>c.size())return a;var d=this.isAnchorsRequired(),b=$.extend(b.state(),{point:c.item(0),width:24,height:32,tooltipVisible:d,vpWidth:this.D99.m_timeScale.m_width,vpHeight:this.D98.m_priceScale.m_height});this._rendererSource.update(b);a.append(new NoteRenderer(this._rendererSource,b));d&&a.append(new SelectionRenderer({points:c}));
|
|
return a};TradingView.LineToolNote=function(a,b){this._constructor="LineToolNote";var c=b?b:new W51("linetoolnote");D46.call(this,a,new NotePaneView(this,a),c);this.version=TradingView.LineToolNote.version};inherit(TradingView.LineToolNote,D46);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;D46.prototype.restoreTemplate.call(this,a)};TradingView.LineToolNoteAbsolute=function(a,b){var c=b?b:new W51("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=D46.prototype.state.call(this,a);a&&(b.state.fixedSize=!1);return b};function PriceLabelRenderer(a,b,c){this._data=a;this._measureCache=b;this._chartModel=c}
|
|
PriceLabelRenderer.prototype.draw=function(a){if(0!==this._data.points.size()){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._data.points.item(0).x- -9,e=this._data.points.item(0).y-(b+15);this._measureCache&&$.extend(this._measureCache,{innerWidth:c,innerHeight:b,tailLeft:-9,tailHeight:15});a.translate(0.5+d,0.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=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(-0.5,-0.5);a.beginPath();a.arc(-9,b+15,2.5,0,2*Math.PI,
|
|
!1);a.fillStyle=generateColor(this._data.borderColor,this._data.transparency);a.fill();a.strokeStyle=this._chartModel.backgroundColor();a.lineWidth=1;a.stroke();a.closePath()}};
|
|
PriceLabelRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._data.points.item(0).x-this._measureCache.tailLeft,c=this._data.points.item(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 HitTestResult(HitTestResult.MOVEPOINT):null};
|
|
function D4(a,b,c){W89.call(this,a,b);this._image=TradingView.getImage("price_label",TradingView.wrapUrl("/static/images/price_label.png"));this._rendererCache={}}inherit(D4,W89);
|
|
D4.prototype.update=function(){W89.prototype.update.call(this);if(0<this.D98.points().size()){var a=this.D98.points().item(0).price,b=this.D98.priceScale();if(b&&!b.isEmpty()){if(b.isPercent())var c=this.D98.ownerSource().firstValue(),a=b.priceRange().convertToPercent(a,c);this._priceLabel=b.formatter().format(a)}}};
|
|
D4.prototype.renderer=function(){var a={};a.points=this._points;a.borderColor=this.D98.properties().borderColor.value();a.backgroundColor=this.D98.properties().backgroundColor.value();a.color=this.D98.properties().color.value();a.fontWeight=this.D98.properties().fontWeight.value();a.fontSize=this.D98.properties().fontsize.value();a.fontFamily=this.D98.properties().font.value();a.transparency=this.D98.properties().transparency.value();a.label=this._priceLabel;
|
|
a.image=this._image;if(this.isAnchorsRequired()&&1==a.points.size()){var b=new CompositeRenderer;b.append(new PriceLabelRenderer(a,this._rendererCache,this.D99));b.append(new SelectionRenderer({points:a.points}));return b}return new PriceLabelRenderer(a,this._rendererCache,this.D99)};TradingView.LineToolPriceLabel=function(a,b){this._constructor="LineToolPriceLabel";var c=b||new W51("linetoolpricelabel");D46.call(this,a,new D4(this,a),c)};
|
|
inherit(TradingView.LineToolPriceLabel,D46);TradingView.LineToolPriceLabel.prototype.pointsCount=function(){return 1};TradingView.LineToolPriceLabel.prototype.title=function(){return"Price Label"};function PredictionRenderer(a){this._data=a;this._targetFontSize2=this._targetFontSize1=11;this._targetFontSize3=14;this._font="Arial";this._sourceFontSize1=12;this._sourceFontSize2=10}
|
|
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)};
|
|
PredictionRenderer.prototype.drawTargetLabel=function(a){var b=this._data.points.item(1);a.save();a.translate(0.5,0.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=generateColor(this._data.targetBackColor,this._data.transparency);a.fill();a.restore();a.save();a.lineWidth=2;a.strokeStyle=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,q;switch(this._data.status){case TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS:k=$.t("SUCCESS");l=generateColor(this._data.successBackground,this._data.transparency);m=this._data.successTextColor;q=this._data.successIcon;break;case TradingView.LineToolPrediction.ALERT_STATUS_FAILURE:k=$.t("FAILURE"),l=generateColor(this._data.failureBackground,this._data.transparency),m=this._data.failureTextColor,q=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(q,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(q,g.x+b-13,g.y+c+5))}a.restore()};
|
|
PredictionRenderer.prototype.drawStartLabel=function(a){a.save();a.translate(0.5,0.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=generateColor(this._data.sourceBackColor,this._data.transparency);
|
|
a.fill();a.lineWidth=2;a.strokeStyle=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()};
|
|
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;if(1>Math.abs(d.x)||1>Math.abs(d.y))var 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;if(d.length()>b)for(;;){var f=g*Math.sin(m),q=h*(1-Math.cos(m)),n=Math.sqrt((f-g)*(f-g)+(q-h)*(q-h));if(1>Math.abs(n-b))break;n>b?k=m:l=m;m=(k+l)/2}f=Math.atan((g-f)/(h-q));
|
|
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()}};
|
|
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 HitTestResult(HitTestResult.MOVEPOINT):null};
|
|
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 HitTestResult(HitTestResult.MOVEPOINT):null};
|
|
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 HitTestResult(HitTestResult.MOVEPOINT):(d=this.targetLabelHitTest(a))?d:this.sourceLabelHitTest(a)};
|
|
function D3(a,b){W89.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(D3,W89);
|
|
D3.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.D98.properties().linecolor.value();a.linewidth=this.D98.properties().linewidth.value();a.targetLine1=this._targetLine1;a.targetLine2=this._targetLine2;a.targetLine3=this._targetLine3;a.targetLine4=this._targetLine4;a.status=this.D98.properties().status.value();a.transparency=this.D98.properties().transparency.value();a.targetBackColor=this.D98.properties().targetBackColor.value();a.targetStrokeColor=
|
|
this.D98.properties().targetStrokeColor.value();a.targetTextColor=this.D98.properties().targetTextColor.value();a.sourceBackColor=this.D98.properties().sourceBackColor.value();a.sourceStrokeColor=this.D98.properties().sourceStrokeColor.value();a.sourceTextColor=this.D98.properties().sourceTextColor.value();a.successBackground=this.D98.properties().successBackground.value();a.successTextColor=this.D98.properties().successTextColor.value();a.failureBackground=this.D98.properties().failureBackground.value();
|
|
a.failureTextColor=this.D98.properties().failureTextColor.value();a.intermediateBackColor=this.D98.properties().intermediateBackColor.value();a.intermediateTextColor=this.D98.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 RGBColor(this.D99.Z1.paneProperties.background._value)).blackWhiteContrast();
|
|
if(this.isAnchorsRequired()){var b=new CompositeRenderer;b.append(new PredictionRenderer(a));a=a.points.clone();this.D99.lineBeingCreated()==this.D98&&a.removeAt(a.size()-1);b.append(this.createLineAnchor({points:a}));return b}return new PredictionRenderer(a)};
|
|
D3.prototype.update=function(){W89.prototype.update.call(this);this._targetLine4=this._targetLine3=this._targetLine2=this._targetLine1="";if(!(2>this.D98.points().size())&&this.D98.priceScale()){var a=this.D98.points().item(1),b=this.D98.points().item(0);this._targetLine3=this.D98.priceScale().formatter().format(a.price);var c=a.price-b.price,d=0>c?"-":"+";this._targetLine1=this.D98.priceScale().formatter().format(Math.abs(c));c=Math.abs((Math.round(1E4*
|
|
(c/b.price))/100).toPrecision(3));this._targetLine1=d+this._targetLine1+" ("+d+c+"%)";d=this.D99.timeScale().indexToUserTime(b.index);c=this.D99.timeScale().indexToUserTime(a.index);b.time&&a.time&&(d=isString(b.time)?new Date(Date.parse(b.time)):b.time,c=isString(a.time)?new Date(Date.parse(a.time)):a.time);c&&d&&(this._targetLine4=(new DateFormatter).format(c),this.D99.mainSeries().isDWM()||(this._targetLine4=this._targetLine4+" "+(new TimeFormatter("%h:%m")).format(c)),a=(c.valueOf()-
|
|
d.valueOf())/1E3,this._targetLine2=$.t("in",{context:"dates"})+" "+(new TimeSpanFormatter).format(a));this._sourceLine1=this.D98.priceScale().formatter().format(b.price);this._sourceLine2="";if(b=this.D99.timeScale().indexToUserTime(b.index))this._sourceLine2=(new DateFormatter).format(b),this.D99.mainSeries().isDWM()||(this._sourceLine2=this._sourceLine2+" "+(new TimeFormatter("%h:%m")).format(b));this._direction=this.D98.direction()===TradingView.LineToolPrediction.DIRECTION_UP?"up":
|
|
"down";this._finished=this.D99.lineBeingCreated()!==this.D98&&this.D99.lineBeingEdited()!==this.D98&&this.D99.sourceBeingMoved()!==this.D98}};TradingView.LineToolPrediction=function(a,b){this._constructor="LineToolPrediction";var c=b?b:new W51("linetoolprediction");c.merge({status:TradingView.LineToolPrediction.ALERT_STATUS_WAITING});D46.call(this,a,new D3(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,D46);TradingView.LineToolPrediction.prototype.status=function(){return this.Z1.status.value()};TradingView.LineToolPrediction.prototype.setStatus=function(a){return this.Z1.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){D46.prototype.restorePoints.call(this,a,b,c);this.checkAlert()};
|
|
TradingView.LineToolPrediction.prototype.checkAlert=function(){if(!(2>this._points.size()||this.D99.mainSeries().bars().isEmpty())){var a=this._points.item(1);if(this.status())a.index>this.D99.timeScale().points().lastTimePointIndex()&&this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_WAITING);else if(this.D99.mainSeries().bars().last(),this.D99.timeScale().indexToTimePoint(a.index)){var b=this.D99.mainSeries().bars().valueAt(a.index),c=this.direction();c===TradingView.LineToolPrediction.DIRECTION_UP&&
|
|
b[HIGH_PLOT]>=a.price?this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS):c===TradingView.LineToolPrediction.DIRECTION_DOWN&&b[LOW_PLOT]<=a.price?this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_SUCCESS):(a=this.D99.mainSeries().bars().last().value,b[TIME_PLOT]!==a[TIME_PLOT]&&this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_FAILURE))}}};
|
|
TradingView.LineToolPrediction.prototype.addPoint=function(a){(a=D46.prototype.addPoint.call(this,a))&&this.checkAlert();return a};TradingView.LineToolPrediction.prototype.endChanging=function(){D46.prototype.endChanging.call(this);this.setStatus(TradingView.LineToolPrediction.ALERT_STATUS_WAITING);this.checkAlert()};TradingView.LineToolPrediction.prototype.onData=function(a){D46.prototype.onData.call(this,a);this.checkAlert()};
|
|
TradingView.LineToolPrediction.prototype.endMoving=function(){D46.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};function D2(a,b){W89.call(this,a,b)}inherit(D2,W89);
|
|
D2.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.D98.properties().linecolor.value();a.linewidth=this.D98.properties().linewidth.value();a.linestyle=this.D98.properties().linestyle.value();a.filled=this.D98.properties().filled.value();a.backcolor=this.D98.properties().backgroundColor.value();a.fillBackground=this.D98.properties().fillBackground.value();a.transparency=this.D98.properties().transparency.value();if(this.isAnchorsRequired()){var b=
|
|
new CompositeRenderer;b.append(new PoligonRenderer(a));a=a.points.clone();this.D99.lineBeingCreated()==this.D98&&a.removeAt(a.size()-1);b.append(this.createLineAnchor({points:a}));return b}return new PoligonRenderer(a)};TradingView.LineToolPolyline=function(a,b){this._constructor="LineToolPolyline";var c;b?c=b:(c=new W51("linetoolpolyline"),c.filled.setValue(!1));D46.call(this,a,new D2(this,a),c)};inherit(TradingView.LineToolPolyline,D46);
|
|
TradingView.LineToolPolyline.prototype.pointsCount=function(){return-1};TradingView.LineToolPolyline.prototype.title=function(){return"Polyline"};
|
|
TradingView.LineToolPolyline.prototype.addPoint=function(a){var b=this.D99.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.D99.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.D99.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.Z1.filled.setValue(!0),this._lastPoint=null,
|
|
this.normalizePoints(),this.createServerPoints(),!0}return D46.prototype.addPoint.call(this,a)};
|
|
TradingView.LineToolPolyline.prototype.setPoint=function(a,b){D46.prototype.setPoint.call(this,a,b);if(!(this.D99.timeScale().isEmpty()||this.priceScale().isEmpty()||a!==this._points.size()-1&&0!==a)){var c=this.D99.timeScale().indexToCoordinate(b.index),d=this.priceScale().priceToCoordinate(b.price),e=this._points.item(0),f=this.D99.timeScale().indexToCoordinate(e.index),e=this.priceScale().priceToCoordinate(e.price);5>(new MathEx.Point(c,d)).substract(new MathEx.Point(f,e)).length()&&
|
|
this.Z1.filled.setValue(!0)}};function W81(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W81,W89);
|
|
W81.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return console.log("W81: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.D98.properties(),k=this.D98.properties().fillHorzBackground.value(),l=this.D98.properties().horzTransparency.value(),m=this.D98.properties().fillVertBackground.value(),q=this.D98.properties().vertTransparency.value(),
|
|
n=0;n<this._hlevels.length;n++){if(0<n&&k){var t=this._hlevels[n-1],b=new MathEx.Point(d,this._hlevels[n].y),c=new MathEx.Point(f,t.y),t={nohittest:!0};t.points=(new List).append(b).append(c);t.color=this._hlevels[n].color;t.linewidth=0;t.backcolor=this._hlevels[n].color;t.fillBackground=!0;t.transparency=l;a.append(new RectangleRenderer(t))}b=new MathEx.Point(d,this._hlevels[n].y);c=new MathEx.Point(f,this._hlevels[n].y);t={points:(new List).append(b).append(c),width:this.D99.timeScale().width(),
|
|
height:this.D98.priceScale().height(),color:this._hlevels[n].color,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(t));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),0<n&&m&&(t=this._vlevels[n-1],d=new MathEx.Point(t.x,e),t={nohittest:!0},t.points=(new List).append(d).append(c),
|
|
t.color=this._vlevels[n].color,t.linewidth=0,t.backcolor=this._vlevels[n].color,t.fillBackground=!0,t.transparency=q,a.append(new RectangleRenderer(t))),t={points:(new List).append(b).append(c),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this._vlevels[n].color,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},a.append(new TrendLineRenderer(t)),
|
|
h.showTopLabels.value()&&(d={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(d,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)));
|
|
this.addAnchors(a);return a};
|
|
W81.prototype.update=function(){W89.prototype.update.call(this);if(!(2>this.D98.points().size()||!this.D98.priceScale()||this.D98.priceScale().isEmpty()||this.D99.timeScale().isEmpty())){var a=this.D98.points().item(0),b=this.D98.points().item(1);this._hlevels=[];var c=b.price-a.price,d;this.D98.priceScale().isPercent()&&(d=this.D98.ownerSource().firstValue());for(var e=1;7>=e;e++){var f="hlevel"+e,g=this.D98.properties()[f];if(g.visible.value()){var f=
|
|
g.coeff.value(),g=g.color.value(),h=a.price+f*c;this.D98.priceScale().isPercent()&&(h=this.D98.priceScale().priceRange().convertToPercent(h,d));h=this.D98.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.D98.properties()[f],g.visible.value()&&(f=g.coeff.value(),g=g.color.value(),c=Math.round(a.index+f*b),c=this.D99.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 W51("linetoolgannsquare");D46.call(this,a,new W81(this,a),c)};inherit(TradingView.LineToolGannSquare,D46);TradingView.LineToolGannSquare.prototype.pointsCount=function(){return 2};TradingView.LineToolGannSquare.prototype.title=function(){return"Gann Box"};function W80(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W80,W89);
|
|
W80.prototype.update=function(){W89.prototype.update.call(this);if(!(2>this.D98.points().size()||!this.D98.priceScale()||this.D98.priceScale().isEmpty()||this.D99.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=1;9>=e;e++){var f="level"+e,f=this.D98.properties()[f];if(f.visible.value()){var g=f.coeff1.value(),h=f.coeff2.value(),k=g/h,l=f.color.value(),m=""+g+"/"+h;g>h?(g=b.x,k=a.y+d/
|
|
k):(g=a.x+c*k,k=b.y);this._fans.push({label:m,color:l,x:g,y:k,index:e,linewidth:f.linewidth.value(),linestyle:f.linestyle.value(),index:e})}}}};
|
|
W80.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0);this._points.item(1);for(var c=this.D98.properties(),d=this.D98.properties().fillBackground.value(),e=this.D98.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.D99.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=TradingView.isMobile.any();a.append(new 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.D99.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=TradingView.isMobile.any(),a.append(new ChannelRenderer(k)));h={points:(new List).append(b).append(g),width:this.D99.timeScale().width(),
|
|
height:this.D98.priceScale().height(),color:this._fans[f].color,linewidth:this._fans[f].linewidth,linestyle:this._fans[f].linestyle,extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};k=new HitTestResult(HitTestResult.MOVEPOINT,null,this._fans[f].index);a.append(new 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.isAnchorsRequired()&&(b=this._points.clone(),this.D99.lineBeingCreated()==this.D98&&b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};TradingView.LineToolGannFan=function(a,b){this._constructor="LineToolGannFan";var c=b?b:new W51("linetoolgannfan");D46.call(this,a,new W80(this,a),c)};inherit(TradingView.LineToolGannFan,D46);
|
|
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")};function W71(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W71,W89);
|
|
W71.prototype.update=function(){W89.prototype.update.call(this);if(!(2>this.D98.points().size()||!this.D98.priceScale()||this.D98.priceScale().isEmpty()||this.D99.timeScale().isEmpty())){var a=this.D98.points().item(0),b=this.D98.points().item(1),c=!1,d=this.D98.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.D98.priceScale().isPercent()&&
|
|
(f=this.D98.ownerSource().firstValue(),null===f))return;for(b=1;11>=b;b++)if(c=d["level"+b],c.visible.value()){var g=c.coeff.value(),h=c.color.value(),k=a+g*e;this.D98.priceScale().isPercent()&&(k=this.D98.priceScale().priceRange().convertToPercent(k,f));var l=this.D98.priceScale().priceToCoordinate(k),m,q=function(a){return d.coeffsAsPercents.value()?""+Math.round(1E4*a)/100+"%":""+a};d.showCoeffs.value()&&d.showPrices.value()?m=""+q(g)+"("+this.D98.priceScale().formatter().format(k)+
|
|
")":d.showCoeffs.value()?m=""+q(g):d.showPrices.value()&&(m=""+this.D98.priceScale().formatter().format(k));this._levels.push({coeff:g,color:h,y:l,label:m,linewidth:c.linewidth.value(),linestyle:c.linestyle.value(),index:b})}}};
|
|
W71.prototype.renderer=function(){var a=new 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.D98.properties(),g=f.fillBackground.value(),h=f.transparency.value(),k=f.extendLines.value()?this.D99.timeScale().width():e,l=0;l<this._levels.length;l++){if(0<l&&g){var c=this._levels[l-1],b=new MathEx.Point(d,this._levels[l].y),c=new MathEx.Point(k,
|
|
c.y),m={};m.nohittest=!TradingView.isMobile.any();m.points=(new List).append(b).append(c);m.color=this._levels[l].color;m.linewidth=0;m.backcolor=this._levels[l].color;m.fillBackground=!0;m.transparency=h;a.append(new RectangleRenderer(m))}var b=new MathEx.Point(d,this._levels[l].y),c=new MathEx.Point(e,this._levels[l].y),m={points:(new List).append(b).append(c),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this._levels[l].color,linewidth:this._levels[l].linewidth,
|
|
linestyle:this._levels[l].linestyle,extendleft:!1,extendright:f.extendLines.value(),leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},q=new HitTestResult(HitTestResult.MOVEPOINT,null,this._levels[l].index);a.append(new TrendLineRenderer(m,q));if(f.showCoeffs.value()||f.showPrices.value()){var n,t,m=f.vertLabelsAlign.value();switch(f.horzLabelsAlign.value()){case "left":n=b;t="right";break;case "center":n=b.add(c).scaled(0.5);t="center";break;case "right":f.extendLines.value()?
|
|
(n=new MathEx.Point(k-4,this._levels[l].y),t="right"):(n=new MathEx.Point(k+4,this._levels[l].y),t="left")}b={points:(new List).append(n),text:this._levels[l].label,color:this._levels[l].color,vertAlign:m,horzAlign:t,font:f.font.value(),offsetX:-5,offsetY:"top"==m?0:-5,fontsize:12};a.append(new TextRenderer(b,this._rendererCache))}}f.trendline.visible.value()&&(m={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),
|
|
color:f.trendline.color.value(),linewidth:f.trendline.linewidth.value(),linestyle:f.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},a.append(new TrendLineRenderer(m)));this.isAnchorsRequired()&&(d=this._points.clone(),this.D99.lineBeingCreated()==this.D98&&d.removeAt(d.size()-1),a.append(this.createLineAnchor({points:d})));return a};
|
|
TradingView.LineToolFibRetracement=function(a,b){this._constructor="LineToolFibRetracement";var c=b?b:new W51("linetoolfibretracement");D46.call(this,a,new W71(this,a),c);this.version=TradingView.LineToolFibRetracement.version};inherit(TradingView.LineToolFibRetracement,D46);TradingView.LineToolFibRetracement.version=2;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")};function D40(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(D40,W89);
|
|
D40.prototype.update=function(){W89.prototype.update.call(this);if(!(3>this.D98.points().size()||!this.D98.priceScale()||this.D98.priceScale().isEmpty()||this.D99.timeScale().isEmpty())){var a=this.D98.points().item(0),b=this.D98.points().item(1),c=this.D98.points().item(2),d=!1,e=this.D98.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.D98.priceScale().isPercent()&&
|
|
(f=this.D98.ownerSource().firstValue());for(b=1;11>=b;b++)if(d=e["level"+b],d.visible.value()){var g=d.coeff.value(),h=d.color.value(),k=c.price+g*a;this.D98.priceScale().isPercent()&&(k=this.D98.priceScale().priceRange().convertToPercent(k,f));var l=function(a){return e.coeffsAsPercents.value()?""+Math.round(1E4*a)/100+"%":""+a},m=this.D98.priceScale().priceToCoordinate(k),q;e.showCoeffs.value()&&e.showPrices.value()?q=""+l(g)+"("+this.D98.priceScale().formatter().format(k)+")":
|
|
e.showCoeffs.value()?q=""+l(g):e.showPrices.value()&&(q=""+this.D98.priceScale().formatter().format(k));this._levels.push({coeff:g,color:h,y:m,label:q,linewidth:d.linewidth.value(),linestyle:d.linestyle.value(),index:b})}}};
|
|
D40.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.D98.properties(),e={points:(new List).append(b).append(c),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,
|
|
rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(e));if(3>this._points.size())return this.addAnchors(a),a;var f=this._points.item(2),e={points:(new List).append(c).append(f),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new 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.D99.timeScale().width():f,m=0;m<this._levels.length;m++){0<m&&h&&(c=this._levels[m-1],b=new MathEx.Point(g,this._levels[m].y),c=new MathEx.Point(l,c.y),e={},e.nohittest=!TradingView.isMobile.any(),e.points=(new List).append(b).append(c),e.color=this._levels[m].color,e.linewidth=0,e.backcolor=this._levels[m].color,e.fillBackground=
|
|
!0,e.transparency=k,a.append(new RectangleRenderer(e)));var b=new MathEx.Point(g,this._levels[m].y),c=new MathEx.Point(f,this._levels[m].y),e={points:(new List).append(b).append(c),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this._levels[m].color,linewidth:this._levels[m].linewidth,linestyle:this._levels[m].linestyle,extendleft:!1,extendright:d.extendLines.value(),leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},q=new HitTestResult(HitTestResult.MOVEPOINT,
|
|
null,this._levels[m].index);a.append(new TrendLineRenderer(e,q));if(d.showCoeffs.value()||d.showPrices.value()){var n,t,e=d.vertLabelsAlign.value();switch(d.horzLabelsAlign.value()){case "left":n=b;t="right";break;case "center":n=b.add(c).scaled(0.5);t="center";break;case "right":d.extendLines.value()?(n=new MathEx.Point(l-4,this._levels[m].y),t="right"):(n=new MathEx.Point(l+4,this._levels[m].y),t="left")}b={points:(new List).append(n),text:this._levels[m].label,color:this._levels[m].color,vertAlign:e,
|
|
horzAlign:t,font:d.font.value(),offsetX:-5,offsetY:"top"==e?0:-5,fontsize:12};a.append(new TextRenderer(b,this._rendererCache))}}this.addAnchors(a);return a};TradingView.LineToolTrendBasedFibExtension=function(a,b){this._constructor="LineToolTrendBasedFibExtension";var c=b?b:new W51("linetooltrendbasedfibextension");D46.call(this,a,new D40(this,a),c);this.version=TradingView.LineToolTrendBasedFibExtension.version};
|
|
inherit(TradingView.LineToolTrendBasedFibExtension,D46);TradingView.LineToolTrendBasedFibExtension.version=2;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")};function W73(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W73,W89);
|
|
W73.prototype.update=function(){W89.prototype.update.call(this);if(!(2>this.D98.points().size()||!this.D98.priceScale()||this.D98.priceScale().isEmpty()||this.D99.timeScale().isEmpty())){var a=this.D98.points().item(0),b=this.D98.points().item(1);this._hlevels=[];var c=b.price-a.price,d;this.D98.priceScale().isPercent()&&(d=this.D98.ownerSource().firstValue());for(var e=1;7>=e;e++){var f="hlevel"+e,g=this.D98.properties()[f];
|
|
if(g.visible.value()){var f=g.coeff.value(),g=g.color.value(),h=a.price+f*c;this.D98.priceScale().isPercent()&&(h=this.D98.priceScale().priceRange().convertToPercent(h,d));h=this.D98.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.D98.properties()[f],g.visible.value()&&(f=g.coeff.value(),g=g.color.value(),c=Math.round(a.index+f*b),c=this.D99.timeScale().indexToCoordinate(c),
|
|
this._vlevels.push({coeff:f,color:g,x:c,index:e}))}};
|
|
W73.prototype.renderer=function(){var a=new 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.D98.properties(),k=h.grid.color.value(),l=h.grid.linewidth.value(),m=h.grid.linestyle.value(),q=0;q<this._hlevels.length;q++){b=new MathEx.Point(d,this._hlevels[q].y);c=new MathEx.Point(f,this._hlevels[q].y);if(h.grid.visible.value()){var n=
|
|
{points:(new List).append(b).append(c),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:k,linewidth:l,linestyle:m,extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(n))}h.showLeftLabels.value()&&(b={points:(new List).append(b),text:""+this._hlevels[q].coeff,color:this._hlevels[q].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[q].coeff,color:this._hlevels[q].color,vertAlign:"middle",horzAlign:"left",font:h.font.value(),offsetX:5,offsetY:0,fontsize:12},a.append(new TextRenderer(c,this._rendererCache)))}for(q=0;q<this._vlevels.length;q++)b=new MathEx.Point(this._vlevels[q].x,e),c=new MathEx.Point(this._vlevels[q].x,g),h.grid.visible.value()&&(n={points:(new List).append(b).append(c),width:this.D99.timeScale().width(),
|
|
height:this.D98.priceScale().height(),color:k,linewidth:l,linestyle:m,extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},a.append(new TrendLineRenderer(n))),h.showTopLabels.value()&&(b={points:(new List).append(b),text:""+this._vlevels[q].coeff,color:this._vlevels[q].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[q].coeff,color:this._vlevels[q].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(q=0;q<this._hlevels.length;q++)m=new MathEx.Point(c.x,this._hlevels[q].y),0<q&&e&&(k=new MathEx.Point(c.x,this._hlevels[q-1].y),l={},l.width=this.D99.timeScale().width(),
|
|
l.p1=b,l.p2=m,l.p3=b,l.p4=k,l.color=this._hlevels[q].color,l.transparency=g,l.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(l))),n={points:(new List).append(b).append(m),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:this._hlevels[q].color,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},k=new HitTestResult(HitTestResult.MOVEPOINT,
|
|
null,{type:"h",index:this._hlevels[q].index}),a.append(new TrendLineRenderer(n,k));for(q=0;q<this._vlevels.length;q++)m=new MathEx.Point(this._vlevels[q].x,c.y),0<q&&e&&(k=new MathEx.Point(this._vlevels[q-1].x,c.y),l={},l.width=this.D99.timeScale().width(),l.p1=b,l.p2=m,l.p3=b,l.p4=k,l.color=this._vlevels[q].color,l.transparency=g,l.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(l))),n={points:(new List).append(b).append(m),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),
|
|
color:this._vlevels[q].color,linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:!1,extendright:!0,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},k=new HitTestResult(HitTestResult.MOVEPOINT,null,{type:"v",index:this._vlevels[q].index}),a.append(new TrendLineRenderer(n,k));this.isAnchorsRequired()&&(h=this._points.clone(),this.D99.lineBeingCreated()==this.D98&&h.removeAt(h.size()-1),a.append(this.createLineAnchor({points:h})));return a};
|
|
TradingView.LineToolFibSpeedResistanceFan=function(a,b){this._constructor="LineToolFibSpeedResistanceFan";var c=b?b:new W51("linetoolfibspeedresistancefan");D46.call(this,a,new W73(this,a),c)};inherit(TradingView.LineToolFibSpeedResistanceFan,D46);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="h"==b.type?"hlevel"+b.index:"vlevel"+b.index,c=this.properties()[c].visible;a.setProperty(c,!1,"Erase level line")};function FibArcRenderer(a,b){this._data=a;this._hittest=b}
|
|
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();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&&(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=generateColor(this._data.color,this._data.transparency),
|
|
a.fill())};FibArcRenderer.prototype.hitTest=function(a){if(MathEx.sign(a.y-this._data.center.y)!==this._data.dir)return null;a=a.substract(this._data.center).length();var b=this._hittest||new HitTestResult(HitTestResult.MOVEPOINT);if(this._data.hittestOnBackground){if(Math.abs(a)<=this._data.radius+3)return b}else if(3>Math.abs(a-this._data.radius))return b;return null};function W72(a,b){W89.call(this,a,b);this._rendererCache={}}
|
|
inherit(W72,W89);
|
|
W72.prototype.update=function(){W89.prototype.update.call(this);if(!(2>this._points.size()||!this.D98.priceScale()||this.D98.priceScale().isEmpty()||this.D99.timeScale().isEmpty())){var a=this._points.item(0),b=this._points.item(1),c=a.substract(b).length();this._levels=[];for(var d=this.D98.properties(),e=1;11>=e;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;d.showCoeffs.value()&&
|
|
(l=""+g);var m=MathEx.sign(b.y-a.y),q=new MathEx.Point(a.x,a.y+m*c*g);this._levels.push({coeff:g,color:h,label:l,radius:k,dir:m,labelPoint:q,linewidth:f.linewidth.value(),linestyle:f.linestyle.value(),index:e})}}}};
|
|
W72.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0);this._points.item(1);for(var c=this.D98.properties(),d=c.fillBackground.value(),e=c.transparency.value(),f=0;f<this._levels.length;f++){var g=this._levels[f],h={};h.center=b;h.color=g.color;h.linewidth=g.linewidth;h.radius=g.radius;h.dir=g.dir;h.transparency=e;h.fillBackground=d;h.hittestOnBackground=TradingView.isMobile.any();0<f&&(h.radius2=this._levels[f-
|
|
1].radius);var k=new HitTestResult(HitTestResult.MOVEPOINT,null,g.index);a.append(new FibArcRenderer(h,k));c.showCoeffs.value()&&(g={points:(new List).append(g.labelPoint),text:this._levels[f].label,color:this._levels[f].color,vertAlign:"middle",horzAlign:"right",font:c.font.value(),offsetX:0,offsetY:0,fontsize:12},a.append(new TextRenderer(g,this._rendererCache)))}c.trendline.visible.value()&&(b={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D99.timeScale().width(),
|
|
height:this.D98.priceScale().height(),color:c.trendline.color.value(),linewidth:c.trendline.linewidth.value(),linestyle:c.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},a.append(new TrendLineRenderer(b)));this.isAnchorsRequired()&&(b=this._points.clone(),this.D99.lineBeingCreated()==this.D98&&b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};
|
|
TradingView.LineToolFibSpeedResistanceArcs=function(a,b){this._constructor="LineToolFibSpeedResistanceArcs";var c=b?b:new W51("linetoolfibspeedresistancearcs");D46.call(this,a,new W72(this,a),c)};inherit(TradingView.LineToolFibSpeedResistanceArcs,D46);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")};function W75(a,b){W89.call(this,a,b);this._levels=[];this._rendererCache={}}inherit(W75,W89);
|
|
W75.prototype.update=function(){W89.prototype.update.call(this);if(!(1>this.D98.points().size()||!this.D98.priceScale()||this.D98.priceScale().isEmpty()||this.D99.timeScale().isEmpty())){var a=this.D98.points().item(0);if(2===this.D98.points().size())var b=this.D98.points().item(1);var c=this.D98.properties(),d=this.D98.points().item(0).index;if(!this.D99.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.D99.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.D98.priceScale().height());this._levels.push(f)}}}};
|
|
W75.prototype.renderer=function(){for(var a=new CompositeRenderer,b=this.D98.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 HitTestResult(HitTestResult.MOVEPOINT,null,this._levels[c].index);a.append(new 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.D98.priceScale().height()),g={nohittest:!0};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 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,0.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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},a.append(new TrendLineRenderer(b)));this.isAnchorsRequired()&&(2===this.D98.points().size()?(b=this._points.clone(),a.append(this.createLineAnchor({points:b}))):0<this._points.size()&&(b=new List,b.append(new MathEx.Point(this._points.item(0).x,
|
|
this.D98.priceScale().height()/2)),a.append(this.createLineAnchor({points:b,hittestResult:HitTestResult.MOVEPOINT}))));return a};TradingView.LineToolFibTimeZone=function(a,b){this._constructor="LineToolFibTimeZone";var c=b?b:new W51("linetoolfibtimezone");D46.call(this,a,new W75(this,a),c);this.version=TradingView.LineToolFibTimeZone.version};inherit(TradingView.LineToolFibTimeZone,D46);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")};function EllipseRendererSimple(a,b){this._data=a;this._hittest=b}
|
|
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(0.5);if(!(1>d||1>e)){if(this._data.wholePoints){var c=this._data.wholePoints.item(0),f=this._data.wholePoints.item(1),g=Math.abs(c.x-f.x);Math.abs(c.y-f.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,g/2,0,2*Math.PI,!0)),a.fillStyle=generateColor(this._data.backcolor,this._data.transparency),a.fill())}};
|
|
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=0.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(0.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));d=this._hittest||new HitTestResult(HitTestResult.MOVEPOINT);if(this._data.fillBackground&&!this._data.noHitTestOnBackground){if(3>
|
|
b)return d}else if(3>Math.abs(b))return d;return null};function W70(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W70,W89);
|
|
W70.prototype.update=function(){W89.prototype.update.call(this);if(!(2>this.D98.points().size()||!this.D98.priceScale()||this.D98.priceScale().isEmpty()||this.D99.timeScale().isEmpty())){var a=this._points.item(0),b=this._points.item(1);this._center=a.add(b).scaled(0.5);var c=Math.abs(b.x-a.x),a=Math.abs(b.y-a.y);this._levels=[];for(var b=this.D98.properties(),d=1;11>=d;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-0.5*c*f,this._center.y-0.5*a*f));h.append(new MathEx.Point(this._center.x+0.5*c*f,this._center.y+0.5*a*f));var k;b.showCoeffs.value()&&(k=f,k=b.coeffsAsPercents.value()?""+Math.round(1E4*k)/100+"%":""+k);var l=new MathEx.Point(this._center.x,this._center.y+0.5*a*f);this._levels.push({coeff:f,color:g,label:k,points:h,labelPoint:l,linewidth:e.linewidth.value(),linestyle:e.linestyle.value(),index:d})}}}};
|
|
W70.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;this._points.item(0);this._points.item(1);for(var b=this.D98.properties(),c=b.fillBackground.value(),d=b.transparency.value(),e=0;e<this._levels.length;e++){var f=this._levels[e],g={};g.points=f.points;g.color=f.color;g.linewidth=f.linewidth;g.backcolor=f.color;0<e&&(g.wholePoints=this._levels[e-1].points);g.fillBackground=c;g.transparency=d;g.noHitTestOnBackground=!TradingView.isMobile.any();
|
|
var h=new HitTestResult(HitTestResult.MOVEPOINT,null,f.index);a.append(new EllipseRendererSimple(g,h));b.showCoeffs.value()&&(f={points:(new List).append(f.labelPoint),text:this._levels[e].label,color:this._levels[e].color,vertAlign:"middle",horzAlign:"right",font:b.font.value(),offsetX:0,offsetY:0,fontsize:12},a.append(new TextRenderer(f,this._rendererCache)))}b.trendline.visible.value()&&(b={points:(new List).append(this._points.item(0)).append(this._points.item(1)),width:this.D99.timeScale().width(),
|
|
height:this.D98.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},a.append(new TrendLineRenderer(b)));this.isAnchorsRequired()&&(b=this._points.clone(),this.D99.lineBeingCreated()==this.D98&&b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};
|
|
TradingView.LineToolFibCircles=function(a,b){this._constructor="LineToolFibCircles";var c=b?b:new W51("linetoolfibcircles");D46.call(this,a,new W70(this,a),c)};inherit(TradingView.LineToolFibCircles,D46);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")};function ArcWedgeRenderer(a,b){this._data=a;this._hittest=b;this._rendererCache={}}
|
|
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,generateColor(this._data.color1,this._data.transparency));b.addColorStop(1,generateColor(this._data.color2,this._data.transparency));a.fillStyle=b}else a.fillStyle=generateColor(this._data.color,this._data.transparency);a.fill()}};
|
|
ArcWedgeRenderer.prototype.hitTest=function(a){var b=a.substract(this._data.center).length(),c=this._hittest||new HitTestResult(HitTestResult.MOVEPOINT);if(this._data.fillBackground){if(b<=this._data.radius){var d=this._data.p1.substract(this._data.center).normalized(),e=this._data.p2.substract(this._data.center).normalized(),b=a.substract(this._data.center).normalized();a=d.dotProduct(e);d=b.dotProduct(d);b=b.dotProduct(e);if(d>=a&&b>=a)return c}}else if(4>=Math.abs(b-this._data.radius)&&(b=a.substract(this._data.p1).length(),
|
|
e=a.substract(this._data.p2).length(),b=Math.max(b,e),e=this._data.p1.substract(this._data.p2).length(),b<=e))return c;return null};function W76(a,b){W89.call(this,a,b);this._rendererCache={};this._levels=[]}inherit(W76,W89);W76.prototype._levelsCount=function(){return 11};
|
|
W76.prototype.update=function(){W89.prototype.update.call(this);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.D98.properties();for(g=1;g<=this._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;f.showCoeffs.value()&&(m=""+h);var q=a.add(d).scaled(0.5).normalized().scaled(l),q=b.add(q);this._levels.push({coeff:h,color:k,label:m,radius:l,labelPoint:q,p1:b.add(a.scaled(l)),p2:b.add(d.scaled(l)),linewidth:e.linewidth.value(),
|
|
linestyle:e.linestyle.value(),index:g})}}};
|
|
W76.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this.D98.properties(),c=this._points,d=c.item(0),e=c.item(1),f={points:(new List).append(d).append(e),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};
|
|
a.append(new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:b.trendline.color.value(),linewidth:b.trendline.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,
|
|
rightend:D46.LINEEND_NORMAL};a.append(new TrendLineRenderer(f));for(c=this._levels.length-1;0<=c;c--){var f=this._levels[c],h={};h.center=this._points.item(0);h.radius=f.radius;h.prevRadius=0<c?this._levels[c-1].radius:0;h.edge=this._edge;h.color=f.color;h.linewidth=1;h.edge1=this._edge1;h.edge2=this._edge2;h.p1=f.p1;h.p2=f.p2;h.fillBackground=b.fillBackground.value();h.transparency=b.transparency.value();var k=new HitTestResult(HitTestResult.MOVEPOINT,null,f.index);a.append(new ArcWedgeRenderer(h,
|
|
k));b.showCoeffs.value()&&(f={points:(new List).append(f.labelPoint),text:this._levels[c].label,color:this._levels[c].color,vertAlign:"middle",horzAlign:"center",font:b.font.value(),offsetX:0,offsetY:0,fontsize:12,bold:!0},a.append(new TextRenderer(f,this._rendererCache)))}this.isAnchorsRequired()&&(c=(new List).append(d).append(e),this.D99.lineBeingCreated()!=this.D98&&c.append(g),a.append(this.createLineAnchor({points:c})));return a};
|
|
TradingView.LineToolFibWedge=function(a,b){this._constructor="LineToolFibSpeedResistanceArcs";var c=b?b:new W51("linetoolfibwedge");D46.call(this,a,new W76(this,a),c)};inherit(TradingView.LineToolFibWedge,D46);TradingView.LineToolFibWedge.prototype.pointsCount=function(){return 3};TradingView.LineToolFibWedge.prototype.title=function(){return"Fib Wedge"};
|
|
TradingView.LineToolFibWedge.prototype.setPoint=function(a,b){D46.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.D99.timeScale().coordinateToIndex(d.x));
|
|
this.Z1.points[1].price.setValue(c);this.Z1.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.D99.timeScale().coordinateToIndex(e.x));this.Z1.points[2].price.setValue(c);this.Z1.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.D99.timeScale().coordinateToIndex(a.x)),price:b}}return D46.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")};function D6(a,b){W76.call(this,a,b)}inherit(D6,W76);D6.prototype.update=function(){W76.prototype.update.call(this)};D6.prototype._levelsCount=function(){return 1};
|
|
D6.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this.D98.properties(),c=this._points,d=c.item(0),e=c.item(1),f={points:(new List).append(d).append(e),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:b.trendline.color.value(),linewidth:b.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};
|
|
a.append(new 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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:b.trendline.color.value(),linewidth:b.linewidth.value(),linestyle:b.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,
|
|
rightend:D46.LINEEND_NORMAL};a.append(new 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 ArcWedgeRenderer(e));this.addAnchors(a);
|
|
return a};TradingView.LineToolProjection=function(a,b){this._constructor="LineToolProjection";var c=b?b:new W51("linetoolprojection");D46.call(this,a,new D6(this,a),c)};inherit(TradingView.LineToolProjection,TradingView.LineToolFibWedge);TradingView.LineToolProjection.prototype.title=function(){return"Projection"};function W67(a,b){W89.call(this,a,b);this._rendererCache=[{},{},{},{},{},{}]}inherit(W67,W89);
|
|
W67.prototype.renderer=function(){if(!this._wave)return null;for(var a=new CompositeRenderer,b=this.D98.properties(),c=b.wavesize.value(),d=this.D98.labels(),e=0;e<this._wave.length;e++)a.append(new TrendLineRenderer(this._wave[e]));var f=1;if(2<this._points.size())var g=this._points.item(2),e=this._points.item(1),f=MathEx.sign(g.y-e.y);var g=[],h=0;this.D99.lineBeingCreated()==this.D98&&(h=1);for(var k=(new RGBColor(this.D99.backgroundColor())).blackWhiteContrast(),
|
|
l=b.color.value(),e=0;e<this._points.size()-h;e++,f=-f){var m=d[c][e],q={points:(new List).append(this._points.item(e)),text:m,color:(new RGBColor(l)).darken("black"==k?15:-15).toHex(),vertAlign:1==f?"top":"bottom",horzAlign:"center",font:"Arial",offsetX:0,offsetY:1==f?5:-10,fontsize:12};g.push(q);b.showBackground.value()&&(q.borderColor=l,q.backgroundColor=generateColor(l,60));""!=m&&a.append(new TextRenderer(q,this._rendererCache[e],new HitTestResult(HitTestResult.CHANGEPOINT,e)))}if(this.isAnchorsRequired()){b=
|
|
new List;for(c=0;c<g.length;c++)d=this._points.item(c).clone(),d.y=g[c].points.item(0).y,d.data=c,b.append(d);this.D99.lineBeingCreated()==this.D98&&0<b.size()&&b.removeAt(b.size()-1);a.append(this.createLineAnchor({points:b}))}return a};
|
|
W67.prototype.update=function(){W89.prototype.update.call(this);this._wave=[];var a=this.D98.properties(),b=this.D98.priceScale(),c=this.D99.timeScale();if(b&&!b.isEmpty()&&!c.isEmpty()){var d;this.D98.priceScale().isPercent()&&(d=this.D98.ownerSource().firstValue());var e=a.color.value();if(a.showWave.value())for(var a=this.D98.points(),f=1;f<a.size();f++){var g=a.item(f-1),h=a.item(f);this.D99.mainSeries().bars().valueAt(g.index);this.D99.mainSeries().bars().valueAt(h.index);
|
|
var k=c.indexToCoordinate(g.index),l=c.indexToCoordinate(h.index),g=g.price,h=h.price;this.D98.priceScale().isPercent()&&(g=this.D98.priceScale().priceRange().convertToPercent(g,d),h=this.D98.priceScale().priceRange().convertToPercent(h,d));g=b.priceToCoordinate(g);h=b.priceToCoordinate(h);k={points:(new List).append(new MathEx.Point(k,g)).append(new MathEx.Point(l,h)),width:c.width(),height:b.height(),color:generateColor(e,0),linewidth:3,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,
|
|
extendright:!1,leftend:D46.LINEEND_CIRCLE,rightend:D46.LINEEND_CIRCLE,endstyle:{strokeWidth:1,fillStyle:this.D99.backgroundColor()},overlayLineEndings:!0};this._wave.push(k)}}};TradingView.LineToolElliott=function(a,b){var c=b?b:new W51("linetoolelliott");D46.call(this,a,new W67(this,a),c)};inherit(TradingView.LineToolElliott,D46);TradingView.LineToolElliott.prototype.title=function(){return"Elliott Labels"};
|
|
TradingView.LineToolElliott5Points=function(a,b){var c=b?b:new W51("linetoolelliott");D46.call(this,a,new W67(this,a),c);this.version=TradingView.LineToolElliott5Points.version};inherit(TradingView.LineToolElliott5Points,TradingView.LineToolElliott);TradingView.LineToolElliott5Points.version=2;TradingView.LineToolElliott5Points.prototype.pointsCount=function(){return 6};
|
|
TradingView.LineToolElliott5Points.prototype.labels=function(){return[" i ii iii iv v".split(" ")," (i) (ii) (iii) (iv) (v)".split(" ")," ((i)) ((ii)) ((iii)) ((iv)) ((v))".split(" ")," 1 2 3 4 5".split(" ")," (1) (2) (3) (4) (5)".split(" ")," ((1)) ((2)) ((3)) ((4)) ((5))".split(" ")," I II III IV V".split(" ")," (I) (II) (III) (IV) (V)".split(" ")," ((I)) ((II)) ((III)) ((IV)) ((V))".split(" ")]};
|
|
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.LineToolElliottSubminuette=function(a,b){this._constructor="LineToolElliottSubminuette";var c=b?b:new W51("linetoolelliottsubminuette");TradingView.LineToolElliott5Points.call(this,a,c)};inherit(TradingView.LineToolElliottSubminuette,TradingView.LineToolElliott5Points);
|
|
TradingView.LineToolElliottMinor=function(a,b){this._constructor="LineToolElliottMinor";var c=b?b:new W51("linetoolelliottminor");TradingView.LineToolElliott5Points.call(this,a,c)};inherit(TradingView.LineToolElliottMinor,TradingView.LineToolElliott5Points);TradingView.LineToolElliottCircle=function(a,b){this._constructor="LineToolElliottCircle";var c=b?b:new W51("linetoolelliottcircle");TradingView.LineToolElliott5Points.call(this,a,c)};
|
|
inherit(TradingView.LineToolElliottCircle,TradingView.LineToolElliott5Points);TradingView.LineToolElliott3Points=function(a,b){var c=b?b:new W51("linetoolelliott");D46.call(this,a,new W67(this,a),c);this.version=TradingView.LineToolElliott3Points.version};inherit(TradingView.LineToolElliott3Points,TradingView.LineToolElliott);TradingView.LineToolElliott3Points.version=2;TradingView.LineToolElliott3Points.prototype.pointsCount=function(){return 4};
|
|
TradingView.LineToolElliott3Points.prototype.labels=function(){return[["","a","b","c"],["","A","B","C"]]};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.LineToolElliottMinorRetr=function(a,b){this._constructor="LineToolElliottMinorRetr";var c=b?b:new W51("linetoolelliottminorretr");TradingView.LineToolElliott3Points.call(this,a,c)};inherit(TradingView.LineToolElliottMinorRetr,TradingView.LineToolElliott3Points);TradingView.LineToolElliottMajorRetr=function(a,b){this._constructor="LineToolElliottMajorRetr";var c=b?b:new W51("linetoolelliottmajorretr");TradingView.LineToolElliott3Points.call(this,a,c)};
|
|
inherit(TradingView.LineToolElliottMajorRetr,TradingView.LineToolElliott3Points);function W92(a,b){W89.call(this,a,b);this._lines=[]}inherit(W92,W89);
|
|
W92.prototype.update=function(){W89.prototype.update.call(this);if(!(2>this.D98.points().size())){var a=this.D99.timeScale();if(this.D98.priceScale()&&!this.D98.priceScale().isEmpty()&&!a.isEmpty()){var b=this.D98.points().item(0),c=this.D98.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)})}}}};
|
|
W92.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.D98.properties(),d={points:(new List).append(b).append(c),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};
|
|
a.append(new TrendLineRenderer(d));d=this.D98.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 VertLineRenderer(c));this.isAnchorsRequired()&&(2===this.D98.points().size()?(d=this._points.clone(),a.append(this.createLineAnchor({points:d}))):(d=new List,d.append(new MathEx.Point(this._points.item(0).x,this.D98.priceScale().height()/
|
|
2)),a.append(this.createLineAnchor({points:d,hittestResult:HitTestResult.MOVEPOINT}))));return a};TradingView.LineToolCircleLines=function(a,b){this._constructor="LineToolCircleLines";var c=b?b:new W51("linetoolcirclelines");D46.call(this,a,new W92(this,a),c)};inherit(TradingView.LineToolCircleLines,D46);TradingView.LineToolCircleLines.prototype.pointsCount=function(){return 2};TradingView.LineToolCircleLines.prototype.title=function(){return"Cyclic Lines"};TradingView.LineToolVbPFixed=function(a,b,c){var d=TradingView.Study.lineToolNameForPointsBasedStudy("VbPFixed@tv-volumebyprice");c=c?c:StudyMetaInfo.findStudyMetaInfo(a.studiesMetaData(),"VbPFixed@tv-volumebyprice");var e=a.studyVersioning();b=b?b:TradingView.prepareStudyProperties(c,null,null,e);var e=new D30(this,a),f=new TradingView.Study.StudyPaneView_hhists(this,a),g=new TradingView.Study.StudyPaneView_polygons(this,a);Q63.call(this,a,[e,f,
|
|
g],b,d);this._turnaroundCounter=1;this._turnaround="vbpfixed_"+this._turnaroundCounter;this._metaInfo=c;this._graphics=new Q62(c);this._formatter=new VolumeFormatter};inherit(TradingView.LineToolVbPFixed,Q63);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.D99.mainSeries().bars().valueAt(c),a=this.D99.mainSeries().bars().valueAt(a),c&&a){c=1E3*c[TIME_PLOT];a=1E3*a[TIME_PLOT];b=[];b.push(this.properties().inputs.rows.value());b.push(this.properties().inputs.volume.value());b.push(c);b.push(a);var d=this;this._studyId?(this._turnaround=
|
|
"vbpfixed_"+ ++this._turnaroundCounter,this.D99.chartApi().modifyStudy(this._studyId,this._turnaround,b,function(a){d.onData(a)})):(this._studyId=TradingView.Study.makeNextStudyId(),this.D99.chartApi().createStudy(this._studyId,this._turnaround,this.D99.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?(D46.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):"",""!==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.D99.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};D8=function(a,b){W89.call(this,a,b);this._rendererCache={}};inherit(D8,W89);D8.prototype._formatInTicks=function(a){var b=this.D99.mainSeries().base();return Math.round(a*b)};D8.INDEX_ENTRY=0;D8.INDEX_CLOSE=1;D8.INDEX_ACTUALENTRY=2;D8.INDEX_ACTUALCLOSE=3;
|
|
D8.prototype.update=function(){W89.prototype.update.call(this);this._profitLevel=this._stopLevel=null;var a=this.D99.timeScale(),b=this.D98.priceScale();if(b&&!b.isEmpty()&&!a.isEmpty()&&0!=this.D98.points().size()&&0!=this._points.size()&&this.D99.mainSeries().bars().last()&&!(2>this.D98.points().size())&&0!=this.D99.mainSeries().bars().size()){if(this._isClosed=4==this.D98.points().size()){a=this.D98.points().item(D8.INDEX_ACTUALCLOSE).price;
|
|
if(this.D98.points().item(D8.INDEX_ACTUALCLOSE).index<parseInt(this.D98.D99.mainSeries().bars().first()))return;var c=Math.min(parseInt(this.D98.D99.mainSeries().bars().last()),this.D98.points().item(D8.INDEX_ACTUALCLOSE).index)}else{if(this.D98.points().item(D8.INDEX_CLOSE).index<parseInt(this.D98.D99.mainSeries().bars().first()))return;c=Math.min(parseInt(this.D98.D99.mainSeries().bars().last()),this.D98.points().item(D8.INDEX_CLOSE).index);
|
|
a=this.D99.mainSeries().bars().valueAt(c)[CLOSE_PLOT]}this._closeBar=this.D98.D99.timeScale().indexToCoordinate(c);var d=this.D98.priceScale(),e=this.D98.stopPrice(),f=this.D98.profitPrice();this._pl=1<this.D98.points().size()?this.D98.calculatePL(a):0;if(d.isPercent())var g=this.D98.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(D8.INDEX_ENTRY).y;
|
|
this._stopLevel=b.priceToCoordinate(e);this._profitLevel=b.priceToCoordinate(f);this._closeLevel=b.priceToCoordinate(a);this._closeBar=this.D98.D99.timeScale().indexToCoordinate(c)}};
|
|
D8.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size()||2>this.D98.points().size())return a;var b=this,c=this.D98.properties();this.D99.timeScale();var d=this._points.item(D8.INDEX_ENTRY).x,e=this._points.item(D8.INDEX_ACTUALENTRY)?this._points.item(D8.INDEX_ACTUALENTRY).x:this._points.item(D8.INDEX_CLOSE).x,f=this._points.item(D8.INDEX_ACTUALCLOSE)?this._points.item(D8.INDEX_ACTUALCLOSE).x:
|
|
this._points.item(D8.INDEX_CLOSE).x,g=this._points.item(D8.INDEX_CLOSE).x,h=new MathEx.Point(d,this._entryLevel),k=new MathEx.Point(g,this._stopLevel),l={};l.points=(new List).append(h).append(k);l.color="white";l.linewidth=0;l.backcolor=c.stopBackground.value();l.fillBackground=!0;l.transparency=c.stopBackgroundTransparency.value();a.append(new RectangleRenderer(l));if(0>this._pl){h=new MathEx.Point(e,this._entryLevel);k=new MathEx.Point(f,this._closeLevel);l={};l.points=
|
|
(new List).append(h).append(k);l.color="white";l.linewidth=0;l.backcolor=c.stopBackground.value();l.fillBackground=!0;var m=0.01*c.stopBackgroundTransparency.value();l.transparency=100-100*(1-m*m*m);a.append(new RectangleRenderer(l))}h=new MathEx.Point(d,this._entryLevel);k=new MathEx.Point(g,this._profitLevel);l={};l.points=(new List).append(h).append(k);l.color="white";l.linewidth=0;l.backcolor=c.profitBackground.value();l.fillBackground=!0;l.transparency=c.profitBackgroundTransparency.value();
|
|
a.append(new RectangleRenderer(l));0<this._pl&&(h=new MathEx.Point(e,this._entryLevel),k=new MathEx.Point(f,this._closeLevel),l={},l.points=(new List).append(h).append(k),l.color="white",l.linewidth=0,l.backcolor=c.profitBackground.value(),l.fillBackground=!0,m=0.01*c.profitBackgroundTransparency.value(),l.transparency=100-100*(1-m*m*m),a.append(new RectangleRenderer(l)));e=function(c,d,e){var f={};f.points=(new List).append(c).append(d);f.width=b.D99.timeScale().width();f.height=b.D98.priceScale().height();
|
|
f.color=e?e:b.D98.properties().linecolor.value();f.linewidth=b.D98.properties().linewidth.value();f.linestyle=CanvasEx.LINESTYLE_SOLID;f.extendleft=!1;f.extendright=!1;f.leftend=D46.LINEEND_NORMAL;f.rightend=D46.LINEEND_NORMAL;a.append(new TrendLineRenderer(f))};this._points.item(D8.INDEX_ACTUALENTRY)&&(h=this._points.item(D8.INDEX_ACTUALENTRY),k=this._isClosed?this._points.item(D8.INDEX_ACTUALCLOSE):new MathEx.Point(this._closeBar,
|
|
this._closeLevel),l={},l.points=(new List).append(h).append(k),l.width=b.D99.timeScale().width(),l.height=b.D98.priceScale().height(),l.color=b.D98.properties().linecolor.value(),l.linewidth=1,l.linestyle=CanvasEx.LINESTYLE_DASHED,l.extendleft=!1,l.extendright=!1,l.leftend=D46.LINEEND_NORMAL,l.rightend=D46.LINEEND_ARROW,a.append(new TrendLineRenderer(l)));var b=this,l=function(d,e,f,g,h,k){if(b.isAnchorsRequired()||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.D98.entryPrice(),m=this.D98.stopPrice(),h=this.D98.profitPrice(),q=Math.abs(m-f),n=Math.round(1E4*q/f)/100,t=Math.abs(h-f),u=Math.round(1E4*t/f)/100,z=Math.abs(f-h)/Math.abs(f-
|
|
m),h=new MathEx.Point(d,this._points.item(D8.INDEX_ENTRY).y),k=new MathEx.Point(g,this._points.item(D8.INDEX_ENTRY).y);e(h,k);h=new MathEx.Point((d+g)/2,Math.round(this._points.item(0).y)+0.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.D98.priceScale().formatter().format(this._pl))+"\n");k+=$.t("Risk/Reward Ratio: {0}").format(Math.round(100*
|
|
z)/100)+" ";z=c.linecolor.value();0>this._pl?z=c.stopBackground.value():0<this._pl&&(z=c.profitBackground.value());l(h,k,z,"middle",0,"white");h=new MathEx.Point(d,this._stopLevel);k=new MathEx.Point(g,this._stopLevel);e(h,k,c.stopBackground.value());h=new MathEx.Point((d+g)/2,this._stopLevel);k=$.t("Stop: {0} ({1}%)").format(this.D98.priceScale().formatter().format(q),n);l(h,k,c.stopBackground.value(),f<m?"bottom":"top",f<m?-12:-1);h=new MathEx.Point(d,this._profitLevel);k=new MathEx.Point(g,
|
|
this._profitLevel);e(h,k,c.profitBackground.value());h=new MathEx.Point((d+g)/2,this._profitLevel);k=$.t("Target: {0} ({1}%)").format(this.D98.priceScale().formatter().format(t),u);l(h,k,c.profitBackground.value(),f<m?"top":"bottom",f<m?-1:-12);this.isAnchorsRequired()&&(e=new List,l=this._points.item(0).clone(),l.data=0,e.append(l),f=new MathEx.Point(d,this._stopLevel),f.data=1,e.append(f),d=new MathEx.Point(d,this._profitLevel),d.data=2,e.append(d),g=new MathEx.Point(g,l.y),g.data=3,e.append(g),
|
|
a.append(this.createLineAnchor({points:e})));return a};function LineToolRiskRewardPriceAxisView(a,b,c,d){this.D98=a;this.D99=b;this._text="";this._coordinate=0;this._background="black";this._textHeight=14;this._pricePropName=c;this._colorPropName=d}inherit(LineToolRiskRewardPriceAxisView,PriceAxisView);
|
|
LineToolRiskRewardPriceAxisView.prototype.update=function(){if(0!==this.D98.points().size()&&this.D98.priceScale()&&!this.D98.priceScale().isEmpty()){var a=this.D98.properties()[this._pricePropName].value();this._background=this.D98.properties()[this._colorPropName].value();this._coordinate=this.D98.priceScale().priceToCoordinate(a);this._textHeight=this.D98.priceScale().m_markBuilder.fontHeight();this._text=this.D98.priceScale().formatter().format(a)}};
|
|
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 PriceAxisViewRenderer(a)};
|
|
TradingView.LineToolRiskReward=function(a,b){var c=b?b:new W51("linetoolriskreward");D46.call(this,a,new D8(this,a),c);this.Z1.addExclusion&&(this.Z1.addExclusion("stopLevel"),this.Z1.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(0.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 LineToolRiskRewardPriceAxisView(this,a,"entryPrice","linecolor");this._stopPriceAxisView=new LineToolRiskRewardPriceAxisView(this,a,"stopPrice","stopBackground");this._profitPriceAxisView=new LineToolRiskRewardPriceAxisView(this,a,"targetPrice","profitBackground");this.version=TradingView.LineToolRiskReward.version};inherit(TradingView.LineToolRiskReward,D46);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?this.D99.paneForSource(this)===a&&b===this.priceScale()?(new List).append(this._entryPriceAxisView).append(this._stopPriceAxisView).append(this._profitPriceAxisView):null:null};
|
|
TradingView.LineToolRiskReward.prototype.updateAllViews=function(){!this._isActualSymbol||!this.Z1.visible.value()||TradingView.drawingState.hideAllDrawings().value()&&this.userEditEnabled()||(D46.prototype.updateAllViews.call(this),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),this._profitPriceAxisView.update())};
|
|
TradingView.LineToolRiskReward.prototype.setPoint=function(a,b){var c=this.priceScale();if(c.isPercent()){var 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));D46.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)),D46.prototype.setPoint.call(this,1,b),this.recalculate()}};TradingView.LineToolRiskReward.PriceProperty=function(a,b){D46.PointPriceProperty.call(this,a,b)};inherit(TradingView.LineToolRiskReward.PriceProperty,D46.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.D99.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.D99.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.D99.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.D99.mainSeries().base();return Math.round(a*b)/b};
|
|
TradingView.LineToolRiskReward.prototype.recalculate=function(){if(this.properties().interval.value()==this.D99.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);D46.prototype.startMoving.call(this,a)};TradingView.LineToolRiskReward.prototype.move=function(a){a.price=this._roundPrice(a.price);D46.prototype.move.call(this,a);this.recalculate();this._entryPriceAxisView.update()};
|
|
TradingView.LineToolRiskReward.prototype.correctPoints=function(a){D46.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.D99.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.D99.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[HIGH_PLOT]>=d&&g[LOW_PLOT]<=d)return{index:e,price:d}}return null};
|
|
TradingView.LineToolRiskRewardShort=function(a,b){this._constructor="LineToolRiskRewardShort";var c=b?b:new W51("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.D99.mainSeries().base()};
|
|
TradingView.LineToolRiskRewardShort.prototype.profitPrice=function(){return this.entryPrice()-this.properties().profitLevel.value()/this.D99.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.D99.mainSeries().base();return Math.max(a,b)};
|
|
TradingView.LineToolRiskRewardShort.prototype.preparseProfitPrice=function(a){a=this._roundPrice(a);var b=this.entryPrice()-1/this.D99.mainSeries().base();return Math.min(a,b)};TradingView.LineToolRiskRewardShort.prototype.checkStopPrice=function(a){var b=this.stopPrice(),c=this.profitPrice();return a[HIGH_PLOT]>=b?this.stopPrice():a[LOW_PLOT]<=c?this.profitPrice():null};
|
|
TradingView.LineToolRiskRewardLong=function(a,b){this._constructor="LineToolRiskRewardLong";var c=b?b:new W51("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.D99.mainSeries().base()};
|
|
TradingView.LineToolRiskRewardLong.prototype.profitPrice=function(){return this.entryPrice()+this.properties().profitLevel.value()/this.D99.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.D99.mainSeries().base();return Math.min(a,b)};
|
|
TradingView.LineToolRiskRewardLong.prototype.preparseProfitPrice=function(a){a=this._roundPrice(a);var b=this.entryPrice()+1/this.D99.mainSeries().base();return Math.max(a,b)};TradingView.LineToolRiskRewardLong.prototype.checkStopPrice=function(a){var b=this.stopPrice(),c=this.profitPrice();return a[LOW_PLOT]<=b?this.stopPrice():a[HIGH_PLOT]>=c?this.profitPrice():null};TradingView.LineToolRiskRewardLong.prototype.title=function(){return"Risk/Reward long"};function W98(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W98,W89);
|
|
W98.prototype.renderer=function(){if(2>this._points.size())return null;var a=this.D98.properties(),b=new 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.D98.properties().color.value(),backgroundRoundRect:4}},f=function(a,b){return{points:(new List).append(a).append(b),width:d.D99.timeScale().width(),height:d.D98.priceScale().height(),color:d.D98.properties().color.value(),linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.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 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 TriangleRenderer(g)));3<=this._points.size()&&(c=this._points.item(0).add(this._points.item(2)).scaled(0.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(0.5),g=f(this._points.item(1),this._points.item(3)),b.append(new 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(0.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 TrendLineRenderer(g)),c=this._points.item(0).add(this._points.item(4)).scaled(0.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.isAnchorsRequired()&&(c=this._points.clone(),this.D99.lineBeingCreated()==this.D98&&c.removeAt(c.size()-1),b.append(this.createLineAnchor({points:c})));return b};
|
|
W98.prototype.update=function(){W89.prototype.update.call(this);if(3<=this.D98.points().size()){var a=this.D98.points().item(0),b=this.D98.points().item(1),c=this.D98.points().item(2);this._ABRetracement=Math.round(1E3*Math.abs((c.price-b.price)/(b.price-a.price)))/1E3}if(4<=this.D98.points().size()){var d=this.D98.points().item(3);this._BCRetracement=Math.round(1E3*Math.abs((d.price-c.price)/(c.price-b.price)))/1E3}if(5<=this.D98.points().size()){var e=
|
|
this.D98.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 W51("linetool5pointspattern");D46.call(this,a,new W98(this,a),c)};inherit(TradingView.LineTool5PointsPattern,D46);
|
|
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;if(b[0]){var c=this.D99.timeScale().indexToUserTime(b[0].index);a.time0.value=c?(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(c):0;a.price0.value=this.D99.mainSeries()._formatter.format(b[0].price)}if(b[1]){var d=this.D99.timeScale().indexToUserTime(b[1].index);a.time1.value=d?(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(d):0;
|
|
a.price1.value=this.D99.mainSeries()._formatter.format(b[1].price)}b[2]&&(c=this.D99.timeScale().indexToUserTime(b[2].index),a.time2.value=c?(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(c):0,a.price2.value=this.D99.mainSeries()._formatter.format(b[2].price));b[3]&&(c=this.D99.timeScale().indexToUserTime(b[3].index),a.time3.value=c?(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(c):0,a.price3.value=this.D99.mainSeries()._formatter.format(b[3].price));
|
|
b[4]&&(c=this.D99.timeScale().indexToUserTime(b[4].index),a.time4.value=d?(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(c):0,a.price4.value=this.D99.mainSeries()._formatter.format(b[4].price))};TradingView.LineTool5PointsPattern.prototype.tooltip=function(){this._updateTooltip();return this._formatTooltip()};function W90(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W90,W89);
|
|
W90.prototype.renderer=function(){if(2>this._points.size())return null;var a=this.D98.properties(),b=new 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.D98.properties().color.value(),backgroundRoundRect:4}},f=function(b,
|
|
c,e,f){return{points:(new List).append(b).append(c),width:d.D99.timeScale().width(),height:d.D98.priceScale().height(),color:generateColor(d.D98.properties().color.value(),e),linewidth:f?f:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL}},g=f(c.item(0),c.item(1),0);b.append(new TrendLineRenderer(g));3<=c.size()&&(g=f(c.item(1),c.item(2),0),b.append(new TrendLineRenderer(g)));
|
|
4==c.size()&&(g=f(c.item(2),c.item(3),0),b.append(new 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(0.5),g=f(this._points.item(0),
|
|
this._points.item(2),70,1),b.append(new 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(0.5),g=f(this._points.item(1),this._points.item(3),70,1),b.append(new TrendLineRenderer(g)),g=e(c,this._CDRetracement),b.append(new TextRenderer(g,this._rendererCache)));this.isAnchorsRequired()&&(c=this._points.clone(),this.D99.lineBeingCreated()==this.D98&&c.removeAt(c.size()-
|
|
1),b.append(this.createLineAnchor({points:c})));return b};
|
|
W90.prototype.update=function(){W89.prototype.update.call(this);if(3<=this.D98.points().size()){var a=this.D98.points().item(0),b=this.D98.points().item(1),c=this.D98.points().item(2);this._ABRetracement=Math.round(1E3*Math.abs((c.price-b.price)/(b.price-a.price)))/1E3}4==this.D98.points().size()&&(a=this.D98.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 W51("linetoolabcd");D46.call(this,a,new W90(this,a),c)};inherit(TradingView.LineToolABCD,D46);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.D99.timeScale().indexToUserTime(b[0].index);a.time0.value=c?(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(c):0;a.price0.value=this.D99.mainSeries()._formatter.format(b[0].price)}b[1]&&(c=this.D99.timeScale().indexToUserTime(b[1].index),a.time1.value=c?(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(c):0,a.price1.value=
|
|
this.D99.mainSeries()._formatter.format(b[1].price));b[2]&&(c=this.D99.timeScale().indexToUserTime(b[2].index),a.time2.value=c?(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(c):0,a.price2.value=this.D99.mainSeries()._formatter.format(b[2].price));b[3]&&(c=this.D99.timeScale().indexToUserTime(b[3].index),a.time3.value=c?(new DateTimeFormatter(this.D99.mainSeries().isDWM())).format(c):0,a.price3.value=this.D99.mainSeries()._formatter.format(b[3].price))};
|
|
TradingView.LineToolABCD.prototype.tooltip=function(){this._updateTooltip();return this._formatTooltip()};function W95(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W95,W89);
|
|
W95.prototype.renderer=function(){if(2>this._points.size())return null;var a=this.D98.properties(),b=new 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.D98.properties().color.value(),backgroundRoundRect:4}},e=function(b,
|
|
d){return{points:(new List).append(b).append(d),width:c.D99.timeScale().width(),height:c.D98.priceScale().height(),color:c.D98.properties().color.value(),linewidth:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL}},f=e(this._points.item(0),this._points.item(1));b.append(new TrendLineRenderer(f));3<=this._points.size()&&(f=e(this._points.item(1),this._points.item(2)),b.append(new TrendLineRenderer(f)));
|
|
4==this._points.size()&&(f=e(this._points.item(2),this._points.item(3)),b.append(new 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 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 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.isAnchorsRequired()&&(e=this._points.clone(),this.D99.lineBeingCreated()==this.D98&&e.removeAt(e.size()-1),b.append(this.createLineAnchor({points:e})));return b};
|
|
W95.prototype.update=function(){W89.prototype.update.call(this);this._valid=!1;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;delete this._intersectPoint;delete this._intersectPoint1;delete this._intersectPoint2;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 W51("linetooltrianglepattern");D46.call(this,a,new W95(this,a),c)};inherit(TradingView.LineToolTrianglePattern,D46);TradingView.LineToolTrianglePattern.prototype.pointsCount=function(){return 4};TradingView.LineToolTrianglePattern.prototype.title=function(){return"Triangle Pattern"};function W94(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W94,W89);
|
|
W94.prototype.renderer=function(){if(2>this._points.size())return null;for(var a=this.D98.properties(),b=new 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.D98.properties().color.value(),backgroundRoundRect:4}},e=function(b,
|
|
d,e,f){return{points:(new List).append(b).append(d),width:c.D99.timeScale().width(),height:c.D98.priceScale().height(),color:generateColor(c.D98.properties().color.value(),e),linewidth:f?f:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.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 TrendLineRenderer(g))}this._retrace1&&(g=
|
|
e(this._points.item(1),this._points.item(3),70,1),b.append(new TrendLineRenderer(g)),f=this._points.item(1).add(this._points.item(3)).scaled(0.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 TrendLineRenderer(g)),f=this._points.item(5).add(this._points.item(3)).scaled(0.5),f=d(f,this._retrace2),b.append(new TextRenderer(f,this._rendererCache)));this.isAnchorsRequired()&&(d=this._points.clone(),
|
|
this.D99.lineBeingCreated()==this.D98&&d.removeAt(d.size()-1),b.append(this.createLineAnchor({points:d})));return b};
|
|
W94.prototype.update=function(){W89.prototype.update.call(this);delete this._retrace1;delete this._retrace2;if(4<=this.D98.points().size()){var a=this.D98.points().item(1),b=this.D98.points().item(2),c=this.D98.points().item(3);this._retrace1=Math.round(100*Math.abs((c.price-b.price)/(b.price-a.price)))/100}6<=this.D98.points().size()&&(c=this.D98.points().item(3),a=this.D98.points().item(4),b=this.D98.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 W51("linetoolthreedrivers");D46.call(this,a,new W94(this,a),c)};inherit(TradingView.LineToolThreeDrivers,D46);TradingView.LineToolThreeDrivers.prototype.pointsCount=function(){return 7};TradingView.LineToolThreeDrivers.prototype.title=function(){return"Three Drivers Pattern"};function W93(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W93,W89);
|
|
W93.prototype.renderer=function(){if(2>this._points.size())return null;for(var a=this.D98.properties(),b=new 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.D98.properties().color.value(),backgroundRoundRect:4}},e=function(b,d,e,f){return{points:(new List).append(b).append(d),
|
|
width:c.D99.timeScale().width(),height:c.D98.priceScale().height(),color:generateColor(c.D98.properties().color.value(),e),linewidth:f?f:a.linewidth.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.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 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 TrendLineRenderer(h));e=f(this._points.item(2),this._points.item(3),this._points.item(4));b.append(new TriangleRenderer(e))}this._intersect1&&
|
|
(e=f(this._intersect1,this._points.item(1),this._points.item(2)),b.append(new TriangleRenderer(e)));this._intersect2&&(e=f(this._points.item(4),this._points.item(5),this._intersect2),b.append(new 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.isAnchorsRequired()&&(d=this._points.clone(),this.D99.lineBeingCreated()==this.D98&&
|
|
d.removeAt(d.size()-1),b.append(this.createLineAnchor({points:d})));return b};
|
|
W93.prototype.update=function(){W89.prototype.update.call(this);delete this._intersect1;delete this._intersect2;if(5<=this._points.size()){var a=this._points.item(0),b=this._points.item(1),c=this._points.item(2);this._points.item(3);var d=this._points.item(4),a=MathEx.intersectSegment(c,d,a,b);null!==a&&(b=d.substract(c),this._intersect1=c.add(b.scaled(a)))}7==this._points.size()&&(a=this._points.item(5),b=this._points.item(6),a=MathEx.intersectSegment(c,
|
|
d,a,b),null!==a&&(b=d.substract(c),this._intersect2=c.add(b.scaled(a))))};TradingView.LineToolHeadAndShoulders=function(a,b){this._constructor="LineToolHeadAndShoulders";var c=b?b:new W51("linetoolheadandshoulders");D46.call(this,a,new W93(this,a),c)};inherit(TradingView.LineToolHeadAndShoulders,D46);TradingView.LineToolHeadAndShoulders.prototype.pointsCount=function(){return 7};TradingView.LineToolHeadAndShoulders.prototype.title=function(){return"Head & Shoulders"};function D41(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(D41,W89);
|
|
D41.prototype.update=function(){W89.prototype.update.call(this);if(!(3>this.D98.points().size()||!this.D98.priceScale()||this.D98.priceScale().isEmpty()||this.D99.timeScale().isEmpty())){var a=this.D98.points().item(0),b=this.D98.points().item(1),c=this.D98.points().item(2);this._levels=[];if(b.index!=a.index&&(a=b.index-a.index,b=this.D98.properties(),c=c.index,!this.D99.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.D99.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.D98.priceScale().height());this._levels.push(e)}}}};
|
|
D41.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.D98.properties(),e={points:(new List).append(b).append(c),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};
|
|
a.append(new TrendLineRenderer(e));if(3>this._points.size())return this.addAnchors(a),a;e=this._points.item(2);e={points:(new List).append(c).append(e),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:d.trendline.color.value(),linewidth:d.trendline.linewidth.value(),linestyle:d.trendline.linestyle.value(),extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};a.append(new 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.D98.priceScale().height()),h={nohittest:!0};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 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,0.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 HitTestResult(HitTestResult.MOVEPOINT,null,this._levels[g].index);a.append(new VertLineRenderer(c,b))}this.addAnchors(a);return a};
|
|
TradingView.LineToolTrendBasedFibTime=function(a,b){this._constructor="LineToolTrendBasedFibTime";var c=b?b:new W51("linetooltrendbasedfibtime");D46.call(this,a,new D41(this,a),c);this.version=TradingView.LineToolTrendBasedFibTime.version};inherit(TradingView.LineToolTrendBasedFibTime,D46);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")};function GannArcRenderer(a){this._data=a}
|
|
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=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()};
|
|
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();if(this._data.fillBack){if(e>=c&&e<=d&&0<=b.x*a.x&&0<=b.y*a.y)return new HitTestResult(HitTestResult.MOVEPOINT)}else if(5>Math.abs(e-d)&&0<=b.x*a.x&&0<=b.y*a.y)return new HitTestResult(HitTestResult.MOVEPOINT);
|
|
return null};function W79(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W79,W89);W79.prototype.update=function(){W89.prototype.update.call(this);this.D98._cornerPoint&&this._points.append(this.D98.pointToScreenPoint(this.D98._cornerPoint)[0])};
|
|
W79.prototype.renderer=function(){var a=this.D98.properties(),b=new 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=0;6>f;f++){var g=a.levels[f];if(g.visible.value()){var h=f/5,k=c.x+h*(d.x-c.x),l=c.y,m=d.y,k={points:(new List).append(new MathEx.Point(k,l)).append(new MathEx.Point(k,m)),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),
|
|
color:g.color.value(),linewidth:g.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};b.append(new TrendLineRenderer(k));l=c.y+h*(d.y-c.y);k=c.x;h=d.x;k={points:(new List).append(new MathEx.Point(k,l)).append(new MathEx.Point(h,l)),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:g.color.value(),linewidth:g.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,
|
|
extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};b.append(new TrendLineRenderer(k))}}for(f in a.fanlines._childs)m=a.fanlines[f],m.visible.value()&&(g=m.x.value(),h=m.y.value(),g>h?(k=d.x,h/=g,l=c.y+h*(d.y-c.y)):(l=d.y,h=g/h,k=c.x+h*(d.x-c.x)),k={points:(new List).append(c).append(new MathEx.Point(k,l)),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:m.color.value(),linewidth:m.width.value(),linestyle:CanvasEx.LINESTYLE_SOLID,
|
|
extendleft:!1,extendright:!1,leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},b.append(new TrendLineRenderer(k)));m=c;for(f in a.arcs._childs){var q=a.arcs[f];q.visible.value()&&(g=q.x.value()/5,h=q.y.value()/5,k=c.x+g*(d.x-c.x),l=c.y+h*(d.y-c.y),(new MathEx.Point(k,l)).substract(c).length(),k={center:c,point:new MathEx.Point(k,l),edge:d,color:q.color.value(),linewidth:q.width.value(),fillBack:a.arcsBackground.fillBackground.value(),transparency:a.arcsBackground.transparency.value(),
|
|
prevPoint:m},b.append(new GannArcRenderer(k)),m=k.point)}this.isAnchorsRequired()&&(a=(new List).append(c).append(e),this.D99.lineBeingCreated()==this.D98&&a.removeAt(a.size()-1),b.append(this.createLineAnchor({points:a})));return b};TradingView.LineToolGannComplex=function(a,b){this._constructor="LineToolGannComplex";var c=b?b:new W51("linetoolganncomplex");D46.call(this,a,new W79(this,a),c)};inherit(TradingView.LineToolGannComplex,D46);
|
|
TradingView.LineToolGannComplex.prototype._recalcSecondPoint=function(){var a=this.D99.mainSeries().properties().style.value(),b=this.D99.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(0.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=D46.prototype.setPoint.call(this,a,b,c);this._fixThirdPoint(c&&c.shift);this._points.setItem(2,this._cornerPoint);delete this._cornerPoint;c=this.D99.mainSeries().properties().style.value();b=this.D99.mainSeries().interval();this._currentStyle=c;this._currentInterval=b;return a};
|
|
TradingView.LineToolGannComplex.prototype.setLastPoint=function(a,b){var c=D46.prototype.setLastPoint.call(this,a,b);this._fixThirdPoint(b&&b.shift);return c};
|
|
TradingView.LineToolGannComplex.prototype.addPoint=function(a,b){var c=this.D99.mainSeries().properties().style.value(),d=this.D99.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){D46.prototype.onData.call(this,a);this._recalcSecondPoint()};function W69(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(W69,W89);
|
|
W69.prototype.update=function(){W89.prototype.update.call(this);if(!(3>this._points.size()||3>this.D98.points().size())){var a=this._points.item(0),b=this._points.item(1);this._points.item(2);this.norm=this._points.item(2).substract(this._points.item(0));this._labels=[];for(var c=this.D98.properties(),a=this.D98.points().item(0),b=this.D98.points().item(1),a=a.price-b.price,b=b.price,d=function(a){return c.coeffsAsPercents.value()?""+Math.round(1E4*a)/
|
|
100+"%":""+a},e=1;11>=e;e++){var f=c["level"+e].coeff.value(),g=b+f*a;if(this.D98.priceScale().isPercent())var h=this.D98.ownerSource().firstValue(),g=this.D98.priceScale().priceRange().convertToPercent(g,h);var k;c.showCoeffs.value()&&c.showPrices.value()?k=""+d(f)+"("+this.D98.priceScale().formatter().format(g)+")":c.showCoeffs.value()?k=""+d(f):c.showPrices.value()&&(k=""+this.D98.priceScale().formatter().format(g));this._labels.push(k)}}};
|
|
W69.prototype.renderer=function(){function a(a,d,e){var g,k,l=c.vertLabelsAlign.value();switch(c.horzLabelsAlign.value()){case "left":g=a;k="right";break;case "center":g=a.add(d).scaled(0.5);k="center";break;case "right":g=d,k="left"}a={points:(new List).append(g),text:e,color:h.color,vertAlign:l,horzAlign:k,font:c.font.value(),offsetX:-5,offsetY:"top"==l?0:-5,fontsize:12};b.append(new TextRenderer(a,f._rendererCache))}var b=new CompositeRenderer;if(2>this._points.size())return this.addAnchors(b),
|
|
b;var c=this.D98.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.D99.timeScale().width(),height:this.D98.priceScale().height(),color:c.level1.color.value(),linewidth:c.level1.linewidth.value(),linestyle:c.level1.linestyle.value(),extendleft:c.extendLeft.value(),extendright:c.extendRight.value(),leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},b.append(new TrendLineRenderer(d)),
|
|
this.addAnchors(b),b;for(var f=this,g=1;11>g;g++){var h=c["level"+g];if(h.visible.value()){for(var k=g+1;11>=k;k++){var l=c["level"+k];if(l.visible.value())break}if(!l)break;var m=this.norm.scaled(h.coeff.value()),k=d.add(m),m=e.add(m),q=this.norm.scaled(l.coeff.value()),n=d.add(q),q=e.add(q),t={};t.points=new List;t.points.append(k);t.points.append(m);t.points.append(n);t.points.append(q);t.color=h.color.value();t.width=this.D99.timeScale().width();t.height=this.D98.priceScale().height();
|
|
t.linewidth=h.linewidth.value();t.linestyle=h.linestyle.value();t.extendleft=c.extendLeft.value();t.extendright=c.extendRight.value();t.backcolor=h.color.value();t.transparency=c.transparency.value();t.skipTopLine=!0;t.fillBackground=c.fillBackground.value();t.hittestOnBackground=TradingView.isMobile.any();b.append(new ParallelChannelRenderer(t));(c.showCoeffs.value()||c.showPrices.value())&&a(k,m,this._labels[g-1])}}h=c.level11;h.visible.value()&&(m=this.norm.scaled(h.coeff.value()),k=d.add(m),m=
|
|
e.add(m),d={points:(new List).append(k).append(m),width:this.D99.timeScale().width(),height:this.D98.priceScale().height(),color:h.color.value(),linewidth:h.linewidth.value(),linestyle:h.linestyle.value(),extendleft:c.extendLeft.value(),extendright:c.extendRight.value(),leftend:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL},b.append(new TrendLineRenderer(d)),(c.showCoeffs.value()||c.showPrices.value())&&a(k,m,this._labels[10]));this.addAnchors(b);return b};
|
|
TradingView.LineToolFibChannel=function(a,b){this._constructor="LineToolFibChannel";var c=b?b:new W51("linetoolfibchannel");D46.call(this,a,new W69(this,a),c);this.version=TradingView.LineToolFibChannel.version};inherit(TradingView.LineToolFibChannel,D46);TradingView.LineToolFibChannel.version=1;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")};function FibSpiralRenderer(a){this._data=a}FibSpiralRenderer.prototype._fibNumbers=function(){return[0,1,2,3,5,8,13,21,34,55,89]};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};
|
|
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/(0.5*Math.PI)+4*d),e=e*c.length()/5,null!==e&&5>Math.abs(e-b))return new HitTestResult(HitTestResult.MOVEPOINT);return null};
|
|
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()};function W74(a,b){W89.call(this,a,b)}inherit(W74,W89);
|
|
W74.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b={};b.points=this._points;b.width=this.D99.timeScale().width();b.height=this.D98.priceScale().height();b.color=this.D98.properties().linecolor.value();b.linewidth=this.D98.properties().linewidth.value();b.linestyle=this.D98.properties().linestyle.value();b.extendleft=!1;b.extendright=!0;b.leftend=D46.LINEEND_NORMAL;b.rightend=D46.LINEEND_NORMAL;
|
|
a.append(new TrendLineRenderer(b));b={};b.points=this._points;b.floatPoints=this._floatPoints;b.width=this.D99.timeScale().width();b.height=this.D98.priceScale().height();b.color=this.D98.properties().linecolor.value();b.linewidth=this.D98.properties().linewidth.value();b.linestyle=this.D98.properties().linestyle.value();a.append(new FibSpiralRenderer(b));this.isAnchorsRequired()&&(a.append(new TrendLineRenderer(b)),b=b.points.clone(),this.D99.lineBeingCreated()==this.D98&&
|
|
b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};TradingView.LineToolFibSpiral=function(a,b){this._constructor="LineToolFibSpiral";var c=b?b:new W51("linetoolfibspiral");D46.call(this,a,new W74(this,a),c)};inherit(TradingView.LineToolFibSpiral,D46);TradingView.LineToolFibSpiral.prototype.pointsCount=function(){return 2};TradingView.LineToolFibSpiral.prototype.title=function(){return"Fib Spiral"};function W66(a,b){W89.call(this,a,b);this._label=null;this._rendererCache={}}inherit(W66,W89);
|
|
W66.prototype.update=function(){W89.prototype.update.call(this);this._label=null;if(!(2>this.D98.points().size())&&this.D98.priceScale()){var a=this.D98.points().item(0),b=this.D98.points().item(1);this._price1=this.D98.priceScale().formatter().format(a.price);this._price2=this.D98.priceScale().formatter().format(b.price);if(3==this.D98.points().size()){var c=this.D98.points().item(2);this._price3=this.D98.priceScale().formatter().format(c.price);
|
|
a=b.price-a.price;this._price4=this.D98.priceScale().formatter().format(c.price+a)}}};
|
|
W66.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.D98.properties(),e=this.D99,f=this.D98,d=f.properties();if(3<=this._points.size()){var g=this._points.item(2);g.x=c.x;var h=c.y-b.y,k=b.clone();k.y=g.y+h;k.data=3;if(d.fillBackground.value()){var l={},h=e.timeScale().width();f.priceScale().height();var m=d.extendLeft.value(),q=d.extendRight.value();m||q?!m&&q?(l={},l.width=
|
|
h,l.p1=b,l.p2=c,l.p3=k,l.p4=g,l.color=d.backgroundColor.value(),l.transparency=d.transparency.value(),l.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(l))):m&&!q?(l={},l.width=h,l.p1=c,l.p2=b,l.p3=g,l.p4=k,l.color=d.backgroundColor.value(),l.transparency=d.transparency.value(),l.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(l))):(l=b.add(c).scaled(0.5),m=k.add(g).scaled(0.5),q={},q.width=h,q.p1=l,q.p2=c,q.p3=m,q.p4=g,q.color=d.backgroundColor.value(),
|
|
q.transparency=d.transparency.value(),q.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(q)),q={},q.width=h,q.p1=l,q.p2=b,q.p3=m,q.p4=k,q.color=d.backgroundColor.value(),q.transparency=d.transparency.value(),q.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(q))):(l.points=new List([b,c,g,k]),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 PoligonRenderer(l)))}}h=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 TrendLineRenderer(h(b,c)));var n=this,l=function(b,c,d,e){n.D98.properties().showPrices.value()&&(d=
|
|
{points:(new List).append(b),text:d,color:n.D98.properties().textcolor.value(),horzAlign:b.x>c.x?"left":"right",vertAlign:"middle",font:n.D98.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:n.D98.properties().bold.value(),italic:n.D98.properties().italic.value(),fontsize:n.D98.properties().fontsize.value()},a.append(new TextRenderer(d,n._rendererCache)),d={points:(new List).append(c),text:e,color:n.D98.properties().textcolor.value(),horzAlign:b.x<c.x?"left":
|
|
"right",vertAlign:"middle",font:n.D98.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:n.D98.properties().bold.value(),italic:n.D98.properties().italic.value(),fontsize:n.D98.properties().fontsize.value()},a.append(new TextRenderer(d,n._rendererCache)))};a.append(new TrendLineRenderer(h(b,c)));l(b,c,this._price1,this._price2);if(2==this._points.size())return this.addAnchors(a),a;a.append(new TrendLineRenderer(h(k,g)));l(g,k,this._price3,this._price4);this.isAnchorsRequired()&&
|
|
(b=(new List).append(b).append(c).append(g).append(k),this.D99.lineBeingCreated()==this.D98&&b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};TradingView.LineToolDisjointAngle=function(a,b){this._constructor="LineToolDisjointAngle";var c=b?b:new W51("linetooldisjointangle");D46.call(this,a,new W66(this,a),c);this.version=TradingView.LineToolDisjointAngle.version};inherit(TradingView.LineToolDisjointAngle,D46);
|
|
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 D46.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 D46.prototype.setLastPoint.call(this,a)};
|
|
TradingView.LineToolDisjointAngle.prototype.setPoint=function(a,b,c){var d=0.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&&D46.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))};function W77(a,b){W89.call(this,a,b);this._label2=this._label1=null;this._rendererCache={}}inherit(W77,W89);
|
|
W77.prototype.update=function(){W89.prototype.update.call(this);this._label2=this._label1=null;if(!(2>this.D98.points().size())&&this.D98.priceScale()){var a=this.D98.points().item(0),b=this.D98.points().item(1);this._price1=this.D98.priceScale().formatter().format(a.price);this._price2=this.D98.priceScale().formatter().format(b.price);3==this.D98.points().size()&&(a=this.D98.points().item(2),this._price3=this.D98.priceScale().formatter().format(a.price))}};
|
|
W77.prototype.renderer=function(){var a=new CompositeRenderer;if(2>this._points.size())return a;var b=this._points.item(0),c=this._points.item(1),d=this.D98.properties(),e=this.D99,f=this.D98;if(3==this._points.size()){var g=this._points.item(2);g.x=c.x;var h=b.clone();h.y=g.y;h.data=3;if(d.fillBackground.value()){var k={},l=e.timeScale().width();f.priceScale().height();var m=d.extendLeft.value(),q=d.extendRight.value();m||q?!m&&q?(k={},k.width=l,k.p1=b,k.p2=c,k.p3=h,k.p4=
|
|
g,k.color=d.backgroundColor.value(),k.transparency=d.transparency.value(),k.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(k))):m&&!q?(k={},k.width=l,k.p1=c,k.p2=b,k.p3=g,k.p4=h,k.color=d.backgroundColor.value(),k.transparency=d.transparency.value(),k.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(k))):(k=b.add(c).scaled(0.5),m=h.add(g).scaled(0.5),q={},q.width=l,q.p1=k,q.p2=c,q.p3=m,q.p4=g,q.color=d.backgroundColor.value(),q.transparency=
|
|
d.transparency.value(),q.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(q)),q={},q.width=l,q.p1=k,q.p2=b,q.p3=m,q.p4=h,q.color=d.backgroundColor.value(),q.transparency=d.transparency.value(),q.hittestOnBackground=TradingView.isMobile.any(),a.append(new ChannelRenderer(q))):(k.points=new List([b,c,g,h]),k.color="rgba(0,0,0,0)",k.linewidth=0,k.linestyle=CanvasEx.LINESTYLE_SOLID,k.filled=!0,k.backcolor=d.backgroundColor.value(),k.fillBackground=!0,k.transparency=d.transparency.value(),
|
|
a.append(new PoligonRenderer(k)))}}l=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 TrendLineRenderer(l(b,c)));if(2==this._points.size())return this.addAnchors(a),a;var n=this,k=function(b,c,d,e){n.D98.properties().showPrices.value()&&
|
|
(d={points:(new List).append(b),text:d,color:n.D98.properties().textcolor.value(),horzAlign:b.x>c.x?"left":"right",vertAlign:"middle",font:n.D98.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:n.D98.properties().bold.value(),italic:n.D98.properties().italic.value(),fontsize:n.D98.properties().fontsize.value()},a.append(new TextRenderer(d,n._rendererCache)),d={points:(new List).append(c),text:e,color:n.D98.properties().textcolor.value(),horzAlign:b.x<c.x?"left":
|
|
"right",vertAlign:"middle",font:n.D98.properties().font.value(),offsetX:b.x>c.x?-5:5,offsetY:-5,bold:n.D98.properties().bold.value(),italic:n.D98.properties().italic.value(),fontsize:n.D98.properties().fontsize.value()},a.append(new TextRenderer(d,n._rendererCache)))};a.append(new TrendLineRenderer(l(b,c)));k(b,c,this._price1,this._price2);if(2==this._points.size())return a;a.append(new TrendLineRenderer(l(h,g)));k(g,h,this._price3,this._price3);this.isAnchorsRequired()&&(b=(new List).append(b).append(c).append(g).append(h),
|
|
this.D99.lineBeingCreated()==this.D98&&b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};TradingView.LineToolFlatBottom=function(a,b){this._constructor="LineToolFlatBottom";var c=b?b:new W51("linetoolflatbottom");D46.call(this,a,new W77(this,a),c);this.version=TradingView.LineToolFlatBottom.version};inherit(TradingView.LineToolFlatBottom,D46);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 D46.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 D46.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?D46.prototype.setPoint.call(this,a,b):this._points.item(0).index=b.index};function IconRenderer(a,b){this._data=a;this._cache=b}
|
|
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)};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 HitTestResult(HitTestResult.MOVEPOINT):null};function W86(a,b){W89.call(this,a,b);this._cache={}}inherit(W86,W89);W86.anchorLimit=80;
|
|
W86.prototype.renderer=function(){var a=new CompositeRenderer;if(1>this._points.size())return a;var b=this.D98.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.D99,e=this.D98;a.append(new 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(W86.anchorLimit,
|
|
g)/2,0),f=new MathEx.Point(0,Math.max(W86.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:D46.LINEEND_NORMAL,rightend:D46.LINEEND_NORMAL};
|
|
d=new TrendLineRenderer(c);d._hittest=null;a.append(d);a.append(this.createLineAnchor({points:(new List).append(b).append(g).append(h).append(f)}))}return a};TradingView.LineToolIcon=function(a,b){this._constructor="LineToolIcon";var c=b?b:new W51("linetoolicon");c.addExclusion("angle");c.addExclusion("scale");D46.call(this,a,new W86(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,D46);
|
|
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){D46.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()<W86.anchorLimit?this._sizeScale=c.size.value()/W86.anchorLimit:this._sizeScale=1;this._origScale=c.scale.value();this._resizeRatio=this._startChangeWidth*this._origScale<W86.anchorLimit?this._startChangeWidth/W86.anchorLimit:
|
|
1};TradingView.LineToolIcon.prototype.endChanging=function(){D46.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.Z1.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.Z1.size.setValue(c),c=Math.acos(-b.x),
|
|
0<Math.asin(b.y)&&(c=2*Math.PI-c),0==a&&(c+=Math.PI),this.Z1.angle.setValue(c)):(a=this._startChangeWidth,b=d.substract(c).length(),this._origScale*a<W86.anchorLimit?(a=W86.anchorLimit/2,this.Z1.scale.setValue(this._origScale*b/a)):this.Z1.scale.setValue(b/(a/2)))};function D9(a,b){W89.call(this,a,b)}inherit(D9,W89);D9.prototype.update=function(){W89.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)};
|
|
D9.prototype.renderer=function(){var a=new CompositeRenderer,b=this.D98.properties(),c=this._points.item(0);if(2<=this._points.size())var d=this._points.item(1);if(2==this._points.size()){var e={};e.points=this._points;e.floatPoints=this._floatPoints;e.width=this.D99.timeScale().width();e.height=this.D98.priceScale().height();e.color=b.color.value();e.linewidth=1;e.linestyle=CanvasEx.LINESTYLE_SOLID;e.extendleft=!1;e.extendright=!1;e.leftend=D46.LINEEND_NORMAL;
|
|
e.rightend=D46.LINEEND_NORMAL;a.append(new TrendLineRenderer(e))}else if(3==this._points.size()){this._points.item(2);var f=d.substract(c),g=(new MathEx.Point(f.y,-f.x)).normalized().scaled(this._distance),h=g.scaled(-1),f=c.add(g),g=d.add(g),k=c.add(h),h=d.add(h),e={};e.points=(new List).append(f).append(g).append(h).append(k);e.color=b.color.value();e.linewidth=this.D98.properties().linewidth.value();e.linestyle=CanvasEx.LINESTYLE_SOLID;e.filled=!0;e.backcolor=b.backgroundColor.value();
|
|
e.fillBackground=b.fillBackground.value();e.transparency=b.transparency.value();a.append(new PoligonRenderer(e))}this.isAnchorsRequired()&&(b=new List,b.append(c),2<=this._points.size()&&b.append(d),3==this._points.size()&&(f.data=2,k.data=2,g.data=2,h.data=2,b.append(f),b.append(k),b.append(g),b.append(h)),a.append(this.createLineAnchor({points:b})));return a};
|
|
TradingView.LineToolRotatedRectangle=function(a,b){this._constructor="LineToolRotatedRectangle";var c=b?b:new W51("linetoolrotatedrectangle");D46.call(this,a,new D9(this,a),c)};inherit(TradingView.LineToolRotatedRectangle,D46);
|
|
TradingView.LineToolRotatedRectangle.prototype.startChanging=function(a,b){D46.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){D46.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"};function AngleRenderer(a){this._data=a}AngleRenderer.prototype.hitTest=function(){return null};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()};
|
|
function D39(a,b){W89.call(this,a,b);this._label=null;this._rendererCache={}}inherit(D39,W89);
|
|
D39.prototype.update=function(){W89.prototype.update.call(this);if(0<this._points.size()&&void 0!==this.D98._angle){var a=this._points.item(0),b=Math.cos(this.D98._angle),c=-Math.sin(this.D98._angle),b=new MathEx.Point(b,c);this._secondPoint=a.addScaled(b,this.D98._distance);this._secondPoint.data=1}this._label=null;if(!(2>this.D98.points().size())){var a=this.D98.points().item(0),c=this.D98.points().item(1),b=[],d,e;if(this.D98.properties().showPriceRange.value()&&
|
|
this.D98.priceScale()){var f=c.price-a.price;d=f/a.price;d=this.D98.priceScale().formatter().format(f)+" ("+(new PercentageFormatter).format(100*d)+")";var g=this.D99.mainSeries().base();g&&(f=Math.round(f*g),d+=", "+f);b.push("priceRange")}this.D98.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}};
|
|
D39.prototype.renderer=function(){var a=new CompositeRenderer;if(this._secondPoint&&0<this._points.size()){var b={};b.points=(new List).append(this._points.item(0)).append(this._secondPoint);b.width=this.D99.timeScale().width();b.height=this.D98.priceScale().height();b.color=this.D98.properties().linecolor.value();b.linewidth=this.D98.properties().linewidth.value();b.linestyle=this.D98.properties().linestyle.value();b.extendleft=this.D98.properties().extendLeft.value();
|
|
b.extendright=this.D98.properties().extendRight.value();b.leftend=D46.LINEEND_NORMAL;b.rightend=D46.LINEEND_NORMAL;a.append(new TrendLineRenderer(b));if((this.isAnchorsRequired()||this.D98.properties().alwaysShowStats.value())&&this._label&&2==this._points.size()){var c={points:(new List).append(this._secondPoint),text:this._label,color:this.D98.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},d=TradingView.LineToolTrendLine.LABEL_OFFSET;this._points.item(1).y<this._points.item(0).y?(c.vertAlign="bottom",c.offsetY=-d):c.offsetY=d;this._points.item(1).x<this._points.item(0).x?(c.horzAlign="right",
|
|
c.offsetX=-d):c.offsetX=d;a.append(new TrendLineStatsRenderer(c,this._rendererCache))}c={};c.point=this._points.item(0);c.angle=this.D98._angle;c.color=this.D98.properties().linecolor.value();c.size=50;a.append(new AngleRenderer(c));c=Math.round(180*c.angle/Math.PI)+"\u00ba";d=this._points.item(0).clone();d.x+=50;c={points:(new List).append(d),text:c,color:this.D98.properties().textcolor.value(),horzAlign:"left",font:this.D98.properties().font.value(),offsetX:5,offsetY:0,bold:this.D98.properties().bold.value(),
|
|
italic:this.D98.properties().italic.value(),fontsize:this.D98.properties().fontsize.value(),vertAlign:"middle"};a.append(new TextRenderer(c,this._rendererCache))}this.isAnchorsRequired()&&this._secondPoint&&(b=b.points.clone(),this.D99.lineBeingCreated()==this.D98&&b.removeAt(b.size()-1),a.append(this.createLineAnchor({points:b})));return a};
|
|
TradingView.LineToolTrendAngle=function(a,b){this._constructor="LineToolTrendAngleLine";var c=b?b:new W51("linetooltrendangle");D46.call(this,a,new D39(this,a),c);this.Z1.addProperty("angle");this.Z1.angle=new TradingView.LineToolTrendAngle.AngleProperty(this)};inherit(TradingView.LineToolTrendAngle,D46);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.D99.updateSource(this._lineSource);this._lineSource.updateAllViews();
|
|
this._lineSource.D99.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=D46.prototype.addPoint.call(this,a,b);c&&this._calculateAngle();return c};TradingView.LineToolTrendAngle.prototype.setLastPoint=function(a,b){D46.prototype.setLastPoint.call(this,a,b);1<this.points().size()&&this._calculateAngle()};TradingView.LineToolTrendAngle.prototype.setPoint=function(a,b,c){D46.prototype.setPoint.call(this,a,b,c);1<this.points().size()&&this._calculateAngle()};
|
|
TradingView.LineToolTrendAngle.prototype.restoreData=function(a){this._angle=a.angle;this._distance=a.distance};TradingView.LineToolTrendAngle.prototype.state=function(a){a=D46.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};var ChartTradingUtils={_fontHeightCache:{},_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);return{r:a[1],g:a[2],b:a[3],a:a[4]||"1"}},getColorFromProperties:function(a,b){var c=1-b.value()/100,d=this._parseColor(a.value());return"rgba("+d.r+","+d.g+","+d.b+","+c+")"},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)))},_parseFont:function(a){var b=document.createElement("div");b.style.font=a;a=b.style.fontSize.match(/(\d+)pt/);return{family:b.style.fontFamily,size:a&&a[0]==b.style.fontSize?a[1]:"",bold:"bold"==b.style.fontWeight,italic:"italic"==b.style.fontStyle}},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(" ")},
|
|
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)},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]},
|
|
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())},repaint:function(a){var b=new Q22(Q22.LIGHT_UPDATE);b.force=!0;a.Z19(b)},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};D46.call(this,a,b,c)};inherit(TradingView.LineToolTrading,D46);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.correctPoints=function(a){D46.prototype.correctPoints.call(this,a);for(var b=0;b<a.size();b++){var c=a.item(b);c.price=ChartTradingUtils.roundToMinTick(this.priceScale(),c.price);a.setItem(b,c)}};function OrderLineAdapter(a){this._line=a;this._data={bodyText:"order",quantityText:"0"}}OrderLineAdapter.prototype.getPrice=function(){return this._line.points().item(0).price};OrderLineAdapter.prototype.setPrice=function(a){this._line.startMoving(this._line.points().item(0));var b=TradingView.merge({},this._line.points().item(0));b.price=a;this._line.move(b);this._line.endMoving(!0);return this};OrderLineAdapter.prototype.getText=function(){return this._data.bodyText};
|
|
OrderLineAdapter.prototype.setText=function(a){this._data.bodyText=a||"";return this};OrderLineAdapter.prototype.getQuantity=function(){return this._data.quantityText};OrderLineAdapter.prototype.setQuantity=function(a){this._data.quantityText=a||"";return this};OrderLineAdapter.prototype.getExtendLeft=function(){var a=this._line.properties().extendLeft.value();return"inherit"==a?this._line.D99.properties().tradingProperties.extendLeft.value():a};
|
|
OrderLineAdapter.prototype.setExtendLeft=function(a){this._line.properties().extendLeft.setValue(a);return this};OrderLineAdapter.prototype.getLineLength=function(){var a=this._line.properties().lineLength.value();return"inherit"==a?this._line.D99.properties().tradingProperties.lineLength.value():a};OrderLineAdapter.prototype.setLineLength=function(a){this._line.properties().lineLength.setValue(Math.max(0,Math.min(a,100)));return this};
|
|
OrderLineAdapter.prototype.getLineColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)};OrderLineAdapter.prototype.setLineColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().lineColor,this._line.properties().lineTransparency);return this};
|
|
OrderLineAdapter.prototype.getLineStyle=function(){var a=this._line.properties().lineStyle.value();return"inherit"==a?this._line.D99.properties().tradingProperties.lineStyle.value():a};OrderLineAdapter.prototype.setLineStyle=function(a){this._line.properties().lineStyle.setValue(a);return this};OrderLineAdapter.prototype.getLineWidth=function(){var a=this._line.properties().lineWidth.value();return"inherit"==a?this._line.D99.properties().tradingProperties.lineWidth.value():a};
|
|
OrderLineAdapter.prototype.setLineWidth=function(a){this._line.properties().lineWidth.setValue(a);return this};OrderLineAdapter.prototype.getBodyBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)};OrderLineAdapter.prototype.setBodyBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency);return this};
|
|
OrderLineAdapter.prototype.getBodyBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)};OrderLineAdapter.prototype.setBodyBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency);return this};
|
|
OrderLineAdapter.prototype.getBodyTextColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)};OrderLineAdapter.prototype.setBodyTextColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency);return this};
|
|
OrderLineAdapter.prototype.getBodyFont=function(){return ChartTradingUtils.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)};OrderLineAdapter.prototype.setBodyFont=function(a){ChartTradingUtils.setFontToProperties(a,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic);return this};
|
|
OrderLineAdapter.prototype.getQuantityBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)};OrderLineAdapter.prototype.setQuantityBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency);return this};
|
|
OrderLineAdapter.prototype.getQuantityBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)};OrderLineAdapter.prototype.setQuantityBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency);return this};
|
|
OrderLineAdapter.prototype.getQuantityTextColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)};OrderLineAdapter.prototype.setQuantityTextColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency);return this};
|
|
OrderLineAdapter.prototype.getQuantityFont=function(){return ChartTradingUtils.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)};
|
|
OrderLineAdapter.prototype.setQuantityFont=function(a){ChartTradingUtils.setFontToProperties(a,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic);return this};OrderLineAdapter.prototype.getCancelButtonBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency)};
|
|
OrderLineAdapter.prototype.setCancelButtonBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency);return this};OrderLineAdapter.prototype.getCancelButtonBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)};
|
|
OrderLineAdapter.prototype.setCancelButtonBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency);return this};OrderLineAdapter.prototype.getCancelButtonIconColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency)};
|
|
OrderLineAdapter.prototype.setCancelButtonIconColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency);return this};OrderLineAdapter.prototype.isFunction=function(a){return"function"===typeof a};OrderLineAdapter.prototype.onCancel=function(a,b){b?this.isFunction(b)&&(this._onCancelData=a,this._onCancelCallback=b):this.isFunction(a)&&(this._onCancelCallback=a);return this};
|
|
OrderLineAdapter.prototype.callOnCancel=function(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)};OrderLineAdapter.prototype.isOnCancelCallbackPresent=function(){return this.isFunction(this._onCancelCallback)};OrderLineAdapter.prototype.onModify=function(a,b){b?this.isFunction(b)&&(this._onModifyData=a,this._onModifyCallback=b):this.isFunction(a)&&(this._onModifyCallback=a);return this};
|
|
OrderLineAdapter.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)};OrderLineAdapter.prototype.onMove=function(a,b){b?this.isFunction(b)&&(this._onMoveData=a,this._onMoveCallback=b):this.isFunction(a)&&(this._onMoveCallback=a);return this};OrderLineAdapter.prototype.callOnMove=function(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)};
|
|
OrderLineAdapter.prototype.remove=function(){this._line.D99.removeSource(this._line);delete this._line};function OrderRenderer(a,b,c){this._data=a;this._cache=b;this._adapter=c}OrderRenderer.prototype._height=function(){return Math.max(20,1+Math.max(ChartTradingUtils.fontHeight(this._adapter.getBodyFont()),ChartTradingUtils.fontHeight(this._adapter.getQuantityFont())))};
|
|
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)};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))};
|
|
OrderRenderer.prototype._cancelButtonWidth=function(){return this._adapter.isOnCancelCallbackPresent()?this._height():0};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()};
|
|
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()};
|
|
OrderRenderer.prototype._drawBody=function(a,b,c){a.save();a.strokeStyle=this._adapter.getBodyBorderColor();a.fillStyle=this._adapter.getBodyBackgroundColor();var d=b+this._bodyWidth(a),e=c+this._height();poly=[{x:b,y:c},{x:d,y:c},{x:d,y:e},{x:b,y:e}];CanvasEx.drawPoly(a,poly,!0);ChartTradingUtils.drawPolyHoverOrPress(a,poly,"body"==this._cache.hoveredArea,"body"==this._cache.pressedArea);a.restore()};
|
|
OrderRenderer.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(),5+b-2,c);a.restore()};
|
|
OrderRenderer.prototype._drawQuantity=function(a,b,c){a.save();a.strokeStyle=this._adapter.getQuantityBorderColor();a.fillStyle=this._adapter.getQuantityBackgroundColor();var d=b+this._quantityWidth(a),e=c+this._height();poly=[{x:b,y:c},{x:d,y:c},{x:d,y:e},{x:b,y:e}];CanvasEx.drawPoly(a,poly,!0);ChartTradingUtils.drawPolyHoverOrPress(a,poly,"quantity"==this._cache.hoveredArea,"quantity"==this._cache.pressedArea);a.restore()};
|
|
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()};
|
|
OrderRenderer.prototype._drawCancelButton=function(a,b,c){a.save();a.strokeStyle=this._adapter.getCancelButtonBorderColor();a.fillStyle=this._adapter.getCancelButtonBackgroundColor();var d=b+this._cancelButtonWidth(),e=c+this._height();poly=[{x:b,y:c},{x:d,y:c},{x:d,y:e},{x:b,y:e}];CanvasEx.drawPoly(a,poly,!0);ChartTradingUtils.drawPolyHoverOrPress(a,poly,"cancelButton"==this._cache.hoveredArea,"cancelButton"==this._cache.pressedArea);a.strokeStyle=this._adapter.getCancelButtonIconColor();var f=(this._cancelButtonWidth()-
|
|
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()};
|
|
OrderRenderer.prototype.draw=function(a){if(this._data.points&&!(this._data.points.size()<TradingView.LineToolOrder.POINTS_COUNT)){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,g=Math.round(this._data.points.item(0).y),h=Math.round(g-(this._height()-1)/2);this._cache.bodyRight=e+c;this._cache.quantityRight=e+c+d;this._cache.top=h;this._cache.bottom=h+this._height();
|
|
this._cache.left=e;this._cache.right=f;this._drawLines(a,e,f,g,b);0!=c&&(this._drawBody(a,e,h),this._drawMovePoints(a,e,h),this._drawBodyText(a,e,h));0!=d&&(this._drawQuantity(a,e+c,h),this._drawQuantityText(a,e+c,h));0!=this._cancelButtonWidth()&&this._drawCancelButton(a,e+c+d,h)}};
|
|
OrderRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._cache,c=this._adapter;return a.y<b.top||a.y>b.bottom||a.x<b.left||a.x>b.right?(delete b.hoveredArea,delete b.pressedArea,null):a.x>=b.left&&a.x<b.bodyRight?(b.hoveredArea="body",delete b.pressedArea,new HitTestResult(HitTestResult.MOVEPOINT)):a.x>=b.bodyRight&&a.x<b.quantityRight?(b.hoveredArea="quantity",new HitTestResult(HitTestResult.CUSTOM,{mouseDownHandler:function(){b.pressedArea="quantity";ChartTradingUtils.repaint(c._line.D99)},
|
|
mouseUpHandler:function(){"quantity"==b.pressedArea&&c.callOnModify();delete b.pressedArea}})):a.x>=b.quantityRight&&a.x<b.right?(b.hoveredArea="cancelButton",new HitTestResult(HitTestResult.CUSTOM,{mouseDownHandler:function(){b.pressedArea="cancelButton";ChartTradingUtils.repaint(c._line.D99)},mouseUpHandler:function(){"cancelButton"==b.pressedArea&&c.callOnCancel();delete b.pressedArea}})):null};function OrderPriceAxisView(a,b){D47.call(this,a,b)}
|
|
inherit(OrderPriceAxisView,D47);OrderPriceAxisView.prototype._updateImpl=function(){D47.prototype._updateImpl.call(this);this._background=this._linetool.properties().lineColor.value()};function OrderPaneView(a,b){W89.call(this,a,b);this._rendererCache={}}inherit(OrderPaneView,W89);
|
|
OrderPaneView.prototype.renderer=function(){var a=new CompositeRenderer;a.append(new OrderRenderer({points:this._points},this._rendererCache,this.D98._adapter));return a};TradingView.LineToolOrder=function(a,b){this._adapter=new OrderLineAdapter(this);this._constructor="LineToolOrder";var c=b||new W51("linetoolorder");TradingView.LineToolTrading.call(this,a,new OrderPaneView(this,a),c)};inherit(TradingView.LineToolOrder,TradingView.LineToolTrading);
|
|
TradingView.LineToolOrder.prototype.title=function(){return"Order"};TradingView.LineToolOrder.prototype.startMoving=function(a){var b=this.paneViews();b&&(b.item(0)._rendererCache.pressedArea="body");D46.prototype.startMoving.call(this,a)};
|
|
TradingView.LineToolOrder.prototype.endMoving=function(a){var b=this.paneViews();b&&delete b.item(0)._rendererCache.pressedArea;b=this.priceScale();b=this._startMovingPoint&&this._currentMovingPoint&&ChartTradingUtils.roundToMinTick(b,this._startMovingPoint.price)!=ChartTradingUtils.roundToMinTick(b,this._currentMovingPoint.price);D46.prototype.endMoving.call(this);!a&&b&&this._adapter.callOnMove()};
|
|
TradingView.LineToolOrder.prototype.createPriceAxisView=function(a){return new OrderPriceAxisView(this,a)};TradingView.LineToolOrder.prototype.paneViews=function(a){return this.D99.properties().tradingProperties.showOrders.value()?D46.prototype.paneViews.call(this,a):null};TradingView.LineToolOrder.prototype.priceAxisViews=function(a,b){return this.D99.properties().tradingProperties.showOrders.value()?D46.prototype.priceAxisViews.call(this,a,b):null};function PositionLineAdapter(a){this._line=a;this._data={bodyText:"position",quantityText:"0"}}PositionLineAdapter.prototype.getPrice=function(){return this._line.points().item(0).price};PositionLineAdapter.prototype.setPrice=function(a){this._line.startMoving(this._line.points().item(0));var b=TradingView.merge({},this._line.points().item(0));b.price=a;this._line.move(b);this._line.endMoving();return this};PositionLineAdapter.prototype.getText=function(){return this._data.bodyText};
|
|
PositionLineAdapter.prototype.setText=function(a){this._data.bodyText=a||"";return this};PositionLineAdapter.prototype.getQuantity=function(){return this._data.quantityText};PositionLineAdapter.prototype.setQuantity=function(a){this._data.quantityText=a||"";return this};PositionLineAdapter.prototype.getExtendLeft=function(){var a=this._line.properties().extendLeft.value();return"inherit"==a?this._line.D99.properties().tradingProperties.extendLeft.value():a};
|
|
PositionLineAdapter.prototype.setExtendLeft=function(a){this._line.properties().extendLeft.setValue(a);return this};PositionLineAdapter.prototype.getLineLength=function(){var a=this._line.properties().lineLength.value();return"inherit"==a?this._line.D99.properties().tradingProperties.lineLength.value():a};PositionLineAdapter.prototype.setLineLength=function(a){this._line.properties().lineLength.setValue(Math.max(0,Math.min(a,100)));return this};
|
|
PositionLineAdapter.prototype.getLineColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)};PositionLineAdapter.prototype.setLineColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().lineColor,this._line.properties().lineTransparency);return this};
|
|
PositionLineAdapter.prototype.getLineStyle=function(){var a=this._line.properties().lineStyle.value();return"inherit"==a?this._line.D99.properties().tradingProperties.lineStyle.value():a};PositionLineAdapter.prototype.setLineStyle=function(a){this._line.properties().lineStyle.setValue(a);return this};PositionLineAdapter.prototype.getLineWidth=function(){var a=this._line.properties().lineWidth.value();return"inherit"==a?this._line.D99.properties().tradingProperties.lineWidth.value():a};
|
|
PositionLineAdapter.prototype.setLineWidth=function(a){this._line.properties().lineWidth.setValue(a);return this};PositionLineAdapter.prototype.getBodyBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)};
|
|
PositionLineAdapter.prototype.setBodyBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency);return this};PositionLineAdapter.prototype.getBodyBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)};
|
|
PositionLineAdapter.prototype.setBodyBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency);return this};PositionLineAdapter.prototype.getBodyTextColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)};
|
|
PositionLineAdapter.prototype.setBodyTextColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency);return this};PositionLineAdapter.prototype.getBodyFont=function(){return ChartTradingUtils.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)};
|
|
PositionLineAdapter.prototype.setBodyFont=function(a){ChartTradingUtils.setFontToProperties(a,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic);return this};PositionLineAdapter.prototype.getQuantityBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)};
|
|
PositionLineAdapter.prototype.setQuantityBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency);return this};PositionLineAdapter.prototype.getQuantityBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)};
|
|
PositionLineAdapter.prototype.setQuantityBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency);return this};PositionLineAdapter.prototype.getQuantityTextColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)};
|
|
PositionLineAdapter.prototype.setQuantityTextColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency);return this};PositionLineAdapter.prototype.getQuantityFont=function(){return ChartTradingUtils.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)};
|
|
PositionLineAdapter.prototype.setQuantityFont=function(a){ChartTradingUtils.setFontToProperties(a,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic);return this};PositionLineAdapter.prototype.getReverseButtonBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency)};
|
|
PositionLineAdapter.prototype.setReverseButtonBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency);return this};PositionLineAdapter.prototype.getReverseButtonBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)};
|
|
PositionLineAdapter.prototype.setReverseButtonBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency);return this};PositionLineAdapter.prototype.getReverseButtonIconColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency)};
|
|
PositionLineAdapter.prototype.setReverseButtonIconColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency);return this};PositionLineAdapter.prototype.getCloseButtonBorderColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency)};
|
|
PositionLineAdapter.prototype.setCloseButtonBorderColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency);return this};PositionLineAdapter.prototype.getCloseButtonBackgroundColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)};
|
|
PositionLineAdapter.prototype.setCloseButtonBackgroundColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency);return this};PositionLineAdapter.prototype.getCloseButtonIconColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency)};
|
|
PositionLineAdapter.prototype.setCloseButtonIconColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency);return this};PositionLineAdapter.prototype.isFunction=function(a){return"function"===typeof a};PositionLineAdapter.prototype.onReverse=function(a,b){b?this.isFunction(b)&&(this._onReverseData=a,this._onReverseCallback=b):this.isFunction(a)&&(this._onReverseCallback=a);return this};
|
|
PositionLineAdapter.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)};PositionLineAdapter.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)};PositionLineAdapter.prototype.onClose=function(a,b){b?this.isFunction(b)&&(this._onCloseData=a,this._onCloseCallback=b):this.isFunction(a)&&(this._onCloseCallback=a);return this};
|
|
PositionLineAdapter.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._onCloseCallback.call(this,this._onCloseData)};PositionLineAdapter.prototype.isOnCloseCallbackPresent=function(){return this.isFunction(this._onCloseCallback)};PositionLineAdapter.prototype.onModify=function(a,b){b?this.isFunction(b)&&(this._onModifyData=a,this._onModifyCallback=b):this.isFunction(a)&&(this._onModifyCallback=a);return this};
|
|
PositionLineAdapter.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)};PositionLineAdapter.prototype.remove=function(){this._line.D99.removeSource(this._line);delete this._line};function PositionRenderer(a,b,c){this._data=a;this._cache=b;this._adapter=c}PositionRenderer.prototype._height=function(){return Math.max(20,1+Math.max(ChartTradingUtils.fontHeight(this._adapter.getBodyFont()),ChartTradingUtils.fontHeight(this._adapter.getQuantityFont())))};
|
|
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)};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))};
|
|
PositionRenderer.prototype._reverseButtonWidth=function(){return this._adapter.isOnReverseCallbackPresent()?this._height():0};PositionRenderer.prototype._closeButtonWidth=function(){return this._adapter.isOnCloseCallbackPresent()?this._height():0};
|
|
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()};
|
|
PositionRenderer.prototype._drawBody=function(a,b,c){a.save();a.strokeStyle=this._adapter.getBodyBorderColor();a.fillStyle=this._adapter.getBodyBackgroundColor();var d=b+this._bodyWidth(a),e=c+this._height();poly=[{x:b,y:c},{x:d,y:c},{x:d,y:e},{x:b,y:e}];CanvasEx.drawPoly(a,poly,!0);ChartTradingUtils.drawPolyHoverOrPress(a,poly,"quantity"==this._cache.hoveredArea,"quantity"==this._cache.pressedArea);a.restore()};
|
|
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()};
|
|
PositionRenderer.prototype._drawQuantity=function(a,b,c){a.save();a.strokeStyle=this._adapter.getQuantityBorderColor();a.fillStyle=this._adapter.getQuantityBackgroundColor();var d=b+this._quantityWidth(a),e=c+this._height();poly=[{x:b,y:c},{x:d,y:c},{x:d,y:e},{x:b,y:e}];CanvasEx.drawPoly(a,poly,!0);ChartTradingUtils.drawPolyHoverOrPress(a,poly,"quantity"==this._cache.hoveredArea,"quantity"==this._cache.pressedArea);a.restore()};
|
|
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()};
|
|
PositionRenderer.prototype._drawReverseButton=function(a,b,c){a.save();a.strokeStyle=this._adapter.getReverseButtonBorderColor();a.fillStyle=this._adapter.getReverseButtonBackgroundColor();var d=b+this._reverseButtonWidth(),e=c+this._height();poly=[{x:b,y:c},{x:d,y:c},{x:d,y:e},{x:b,y:e}];CanvasEx.drawPoly(a,poly,!0);ChartTradingUtils.drawPolyHoverOrPress(a,poly,"reverseButton"==this._cache.hoveredArea,"reverseButton"==this._cache.pressedArea);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()};
|
|
PositionRenderer.prototype._drawCloseButton=function(a,b,c){a.save();a.strokeStyle=this._adapter.getCloseButtonBorderColor();a.fillStyle=this._adapter.getCloseButtonBackgroundColor();var d=b+this._closeButtonWidth(),e=c+this._height();poly=[{x:b,y:c},{x:d,y:c},{x:d,y:e},{x:b,y:e}];CanvasEx.drawPoly(a,poly,!0);ChartTradingUtils.drawPolyHoverOrPress(a,poly,"closeButton"==this._cache.hoveredArea,"closeButton"==this._cache.pressedArea);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()};
|
|
PositionRenderer.prototype.draw=function(a){if(this._data.points&&!(this._data.points.size()<TradingView.LineToolPosition.POINTS_COUNT)){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)}};
|
|
PositionRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._cache,c=this._adapter;return a.y<b.top||a.y>b.bottom||a.x<b.left||a.x>b.right?(delete b.hoveredArea,delete b.pressedArea,null):a.x>=b.left&&a.x<b.quantityRight?(b.hoveredArea="quantity",new HitTestResult(HitTestResult.CUSTOM,{mouseDownHandler:function(){b.pressedArea="quantity";ChartTradingUtils.repaint(c._line.D99)},mouseUpHandler:function(){"quantity"==b.pressedArea&&c.callOnModify();delete b.pressedArea}})):
|
|
a.x>=b.quantityRight&&a.x<b.reverseButtonRight?(b.hoveredArea="reverseButton",new HitTestResult(HitTestResult.CUSTOM,{mouseDownHandler:function(){b.pressedArea="reverseButton";ChartTradingUtils.repaint(c._line.D99)},mouseUpHandler:function(){"reverseButton"==b.pressedArea&&c.callOnReverse();delete b.pressedArea}})):a.x>=b.reverseButtonRight&&a.x<b.right?(b.hoveredArea="closeButton",new HitTestResult(HitTestResult.CUSTOM,{mouseDownHandler:function(){b.pressedArea="closeButton";ChartTradingUtils.repaint(c._line.D99)},
|
|
mouseUpHandler:function(){"closeButton"==b.pressedArea&&c.callOnClose();delete b.pressedArea}})):null};function PositionPriceAxisView(a,b){D47.call(this,a,b)}inherit(PositionPriceAxisView,D47);PositionPriceAxisView.prototype._updateImpl=function(){D47.prototype._updateImpl.call(this);this._background=this._linetool.properties().lineColor.value()};function PositionPaneView(a,b){W89.call(this,a,b);this._rendererCache={}}
|
|
inherit(PositionPaneView,W89);PositionPaneView.prototype.renderer=function(){var a=new CompositeRenderer;a.append(new PositionRenderer({points:this._points},this._rendererCache,this.D98._adapter));return a};TradingView.LineToolPosition=function(a,b){this._adapter=new PositionLineAdapter(this);this._constructor="LineToolPosition";var c=b||new W51("linetoolposition");TradingView.LineToolTrading.call(this,a,new PositionPaneView(this,a),c)};
|
|
inherit(TradingView.LineToolPosition,TradingView.LineToolTrading);TradingView.LineToolPosition.prototype.title=function(){return"Position"};TradingView.LineToolPosition.prototype.createPriceAxisView=function(a){return new PositionPriceAxisView(this,a)};TradingView.LineToolPosition.prototype.paneViews=function(a){return this.D99.properties().tradingProperties.showPositions.value()?D46.prototype.paneViews.call(this,a):null};
|
|
TradingView.LineToolPosition.prototype.priceAxisViews=function(a,b){return this.D99.properties().tradingProperties.showPositions.value()?D46.prototype.priceAxisViews.call(this,a,b):null};function ExecutionsPositionController(a,b){this._pane=a;this._timeScale=b}
|
|
ExecutionsPositionController.prototype.getYCoordinate=function(a){var b=0,c=a.getDirection(),d=a._line.points().item(0).index,e=this._pane.mainDataSource();if(e.bars)var b="buy"==c?10:-10,f="buy"==c?e.bars().valueAt(d)[LOW_PLOT]:e.bars().valueAt(d)[HIGH_PLOT],b=e.priceScale().priceToCoordinate(f)+b;e=this._pane.orderedSources();for(f=e.length-1;0<=f;--f){var g=e[f];if(isInherited(g.constructor,TradingView.LineToolExecution)&&g._adapter.getDirection()==c&&g.points().item(0).index==d){if(g==a._line)break;
|
|
b="buy"==c?b+g._adapter._height():b-g._adapter._height()}}return b};function ExecutionLineAdapter(a){this._line=a}ExecutionLineAdapter.prototype._height=function(){var a=this.getArrowHeight(),b=this.getArrowSpacing(),c=ChartTradingUtils.fontHeight(this.getFont());return a+b+c+10};ExecutionLineAdapter.prototype.getIndex=function(){var a=this._line.D99.timeScale().m_points.lastTimePointIndex(),b=this._line.points().item(0).index;return a-b};
|
|
ExecutionLineAdapter.prototype.setIndex=function(a){a=this._line.D99.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};ExecutionLineAdapter.prototype.getTime=function(){var a=this._line.D99.timeScale(),b=this._line.points().item(0).index;return(a=a.indexToTimePoint(b))&&a.valueOf()/1E3};
|
|
ExecutionLineAdapter.prototype.setTime=function(a){this._line.startMoving(this._line.points().item(0));var b=TradingView.merge({},this._line.points().item(0));b.index=this._line.D99.timeScale().timePointToIndex(a);this._line.move(b);this._line.endMoving();return this};ExecutionLineAdapter.prototype.getPrice=function(){return this._line.points().item(0).price};
|
|
ExecutionLineAdapter.prototype.setPrice=function(a){this._line.startMoving(this._line.points().item(0));var b=TradingView.merge({},this._line.points().item(0));b.price=a;this._line.move(b);this._line.endMoving();return this};ExecutionLineAdapter.prototype.getText=function(){return this._line.properties().text.value()};ExecutionLineAdapter.prototype.setText=function(a){this._line.properties().text.setValue(a||"");return this};ExecutionLineAdapter.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()};
|
|
ExecutionLineAdapter.prototype.setArrowHeight=function(a){this._line.properties().arrowHeight.setValue(a||5);return this};ExecutionLineAdapter.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()};ExecutionLineAdapter.prototype.setArrowSpacing=function(a){this._line.properties().arrowSpacing.setValue(a||1);return this};ExecutionLineAdapter.prototype.getDirection=function(){return this._line.properties().direction.value()};
|
|
ExecutionLineAdapter.prototype.setDirection=function(a){this._line.properties().direction.setValue(a||"buy");return this};ExecutionLineAdapter.prototype.getArrowColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().arrowColor,this._line.properties().arrowTransparency)};ExecutionLineAdapter.prototype.setArrowColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().arrowColor,this._line.properties().arrowTransparency);return this};
|
|
ExecutionLineAdapter.prototype.getTextColor=function(){return ChartTradingUtils.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)};ExecutionLineAdapter.prototype.setTextColor=function(a){ChartTradingUtils.setColorToProperties(a,this._line.properties().textColor,this._line.properties().textTransparency);return this};
|
|
ExecutionLineAdapter.prototype.getFont=function(){return ChartTradingUtils.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)};ExecutionLineAdapter.prototype.setFont=function(a){ChartTradingUtils.setFontToProperties(a,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic);return this};
|
|
ExecutionLineAdapter.prototype.remove=function(){this._line.D99.removeSource(this._line);delete this._line};function ExecutionRenderer(a,b){this._data=a;this._adapter=b}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};
|
|
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()};
|
|
ExecutionRenderer.prototype._drawText=function(a,b,c){a.save();a.textAlign="center";a.textBaseline="middle";a.font=this._adapter.getFont();a.fillStyle=this._adapter.getTextColor();b+=this._textWidth(a)/2;c+=ChartTradingUtils.fontHeight(this._adapter.getFont())/2;a.fillText(this._adapter.getText(),b,c-1);a.restore()};
|
|
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+0.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=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)}}};ExecutionRenderer.prototype.hitTest=function(a){return null};function ExecutionPaneView(a,b){W89.call(this,a,b)}inherit(ExecutionPaneView,W89);ExecutionPaneView.prototype.update=function(){W89.prototype.update.call(this)};
|
|
ExecutionPaneView.prototype.renderer=function(){var a=new CompositeRenderer,b=this.D98._adapter,c=this.D98.D99.paneForSource(this.D98).executionsPositionController(),d=this._points.item(0).x,c=c.getYCoordinate(b),e=new List;e.append({x:d,y:c});a.append(new ExecutionRenderer({points:e},b));return a};
|
|
TradingView.LineToolExecution=function(a,b){this._adapter=new ExecutionLineAdapter(this);this._constructor="LineToolExecution";var c=b||new W51("linetoolexecution");this.customization={forcePriceAxisLabel:!1,disableSelection:!0,disableErasing:!0};D46.call(this,a,new ExecutionPaneView(this,a),c)};inherit(TradingView.LineToolExecution,D46);TradingView.LineToolExecution.POINTS_COUNT=1;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 this.D99.properties().tradingProperties.showExecutions.value()?D46.prototype.paneViews.call(this,a):null};Q24=function(a,b,c){var d=this._mtpStudyId()+"@mtp-mtpredictor";c=c||StudyMetaInfo.findStudyMetaInfo(a.studiesMetaData(),d);b=b||TradingView.prepareStudyProperties(c,null,null,a.studyVersioning());d=TradingView.Study.lineToolNameForPointsBasedStudy(d);Q63.call(this,a,this.createPaneViews(a),b,d);this._doNotNeedLine=!0;this._turnaroundCounter=0;this._nextTurnaround();this._metaInfo=c;this._graphics=new Q62(c);this._formatter=new VolumeFormatter};
|
|
inherit(Q24,Q63);Q24.prototype.series=function(){return isInherited(this._ownerSource.constructor,TradingView.Series)?this._ownerSource:this._ownerSource.series()};Q24.prototype.calcIsActualSymbol=function(){return D46.prototype.calcIsActualSymbol.call(this)};Q24.prototype._nextTurnaround=function(){this._turnaround=this._mtpStudyId()+"_"+ ++this._turnaroundCounter};
|
|
Q24.prototype.createPaneViews=function(a){return[new D30(this,a),new TradingView.Study.StudyPaneView_textmarks(this,a),new TradingView.Study.StudyPaneView_polygons(this,a),new TradingView.Study.StudyPaneView_lines(this,a)]};
|
|
Q24.prototype.onData=function(a){"data_update"===a.method&&a.params.customId==="pointset_"+this._currentPointsetId?(D46.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.D99.updateSource(this))};
|
|
Q24.prototype._requestStudy=function(){var a=this,b=function(b){a.onData(b)},c=this._studyInputs();c&&(this._studyId?(this._nextTurnaround(),this.D99.chartApi().modifyStudy(this._studyId,this._turnaround,c,b)):(this._studyId=TradingView.Study.makeNextStudyId(),this.D99.chartApi().createStudy(this._studyId,this._turnaround,this.D99.mainSeries()._seriesId,this._metaInfo.id+"-1!",c,b)))};Q37=function(a,b,c){Q24.call(this,a,b,c)};inherit(Q37,Q24);Q37.prototype._mtpStudyId=function(){return"mtp_riskreward"};Q37.prototype.pointsCount=function(){return 3};
|
|
Q37.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"};
|
|
Q37.prototype._studyInputs=function(){var a=this.points().item(0).index,b=this.points().item(1).index,c=this.points().item(2).index,a=this.D99.mainSeries().bars().valueAt(a),b=this.D99.mainSeries().bars().valueAt(b),c=this.D99.mainSeries().bars().valueAt(c);return a&&b&&c?[1E3*a[TIME_PLOT],1E3*b[TIME_PLOT],1E3*c[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};Q26=function(a,b,c){Q24.call(this,a,b,c);this._symbolIntervalChanged=!1;this.D99.mainSeries().onSymbolIntervalChanged().subscribe(this,this.onSymbolIntervalChanged)};inherit(Q26,Q24);Q26.prototype._mtpStudyId=function(){return"mtp_decisionpoint"};
|
|
Q26.prototype.onSymbolIntervalChanged=function(){this._symbolIntervalChanged=!0};Q26.prototype.pointsCount=function(){return 1};Q26.prototype._studyInputs=function(){var a=this.points().item(0).index;return(a=this.D99.mainSeries().bars().valueAt(a))?[this.properties().inputs.displayZoneLabels.value(),this._symbolIntervalChanged,1E3*a[TIME_PLOT]]:null};
|
|
Q26.prototype.onData=function(a){Q24.prototype.onData.call(this,a);this._symbolIntervalChanged=!1};Q33=function(a,b,c){Q24.call(this,a,b,c)};inherit(Q33,Q24);Q33.prototype.pointsCount=function(){return 1};Q33.prototype._studyInputs=function(){var a=this.points().item(0).index;return(a=this.D99.mainSeries().bars().valueAt(a))?[this.properties().inputs.displayZoneLabels.value(),1E3*a[TIME_PLOT]]:null};
|
|
Q34=function(a,b,c){Q33.call(this,a,b,c)};inherit(Q34,Q33);Q34.prototype._mtpStudyId=function(){return"mtp_ew_main"};Q35=function(a,b,c){Q33.call(this,a,b,c)};inherit(Q35,Q33);
|
|
Q35.prototype._mtpStudyId=function(){return"mtp_ew_major"};Q36=function(a,b,c){Q33.call(this,a,b,c)};inherit(Q36,Q33);Q36.prototype._mtpStudyId=function(){return"mtp_ew_minor"};Q25=function(a,b,c){Q24.call(this,a,b,c)};inherit(Q25,Q24);Q25.prototype._mtpStudyId=function(){return"mtp_tsanalysis"};Q25.prototype.pointsCount=function(){return 1};
|
|
Q25.prototype._studyInputs=function(){var a=this.points().item(0).index;return(a=this.D99.mainSeries().bars().valueAt(a))?[this.properties().inputs.displayZoneLabels.value(),1E3*a[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};Q44=function(a,b,c,d,e){this._wptStudyId=d;this._pointsCount=e;Q24.call(this,a,b,c)};inherit(Q44,Q24);
|
|
Q44.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.D99.mainSeries().bars().valueAt(c);if(!c)return null;a.push(1E3*c[TIME_PLOT])}return a};Q44.prototype._mtpStudyId=function(){return this._wptStudyId};Q44.prototype.pointsCount=function(){return this._pointsCount};
|
|
Q27=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_down1ora",2)};inherit(Q27,Q44);Q27.getTooltipText=function(a){return"Down Wave 1 or A: Select Point "+((a?a._points.size():0)+1)};Q28=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_down2orb",2)};
|
|
inherit(Q28,Q44);Q28.getTooltipText=function(a){return"Down Wave 2 or B: Select Point "+((a?a._points.size():0)+1)};Q29=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_down3",3)};inherit(Q29,Q44);
|
|
Q29.getTooltipText=function(a){return"Down Wave 3: Select Point "+((a?a._points.size():0)+1)};Q30=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_down4",2)};inherit(Q30,Q44);Q30.getTooltipText=function(a){return"Down Wave 4: Select Point "+((a?a._points.size():0)+1)};
|
|
Q31=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_down5",5)};inherit(Q31,Q44);Q31.getTooltipText=function(a){return"Down Wave 5: Select Point "+((a?a._points.size():0)+1)};Q32=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_downc",3)};
|
|
inherit(Q32,Q44);Q32.getTooltipText=function(a){return"Down Wave C: Select Point "+((a?a._points.size():0)+1)};Q38=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_up1ora",2)};inherit(Q38,Q44);
|
|
Q38.getTooltipText=function(a){return"Up Wave 1 or A: Select Point "+((a?a._points.size():0)+1)};Q39=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_up2orb",2)};inherit(Q39,Q44);Q39.getTooltipText=function(a){return"Up Wave 2 or B: Select Point "+((a?a._points.size():0)+1)};
|
|
Q40=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_up3",3)};inherit(Q40,Q44);Q40.getTooltipText=function(a){return"Up Wave 3: Select Point "+((a?a._points.size():0)+1)};Q41=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_up4",2)};
|
|
inherit(Q41,Q44);Q41.getTooltipText=function(a){return"Up Wave 4: Select Point "+((a?a._points.size():0)+1)};Q42=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_up5",5)};inherit(Q42,Q44);
|
|
Q42.getTooltipText=function(a){return"Up Wave 5: Select Point "+((a?a._points.size():0)+1)};Q43=function(a,b,c){Q44.call(this,a,b,c,"mtp_wpt_upc",3)};inherit(Q43,Q44);Q43.getTooltipText=function(a){return"Up Wave C: Select Point "+((a?a._points.size():0)+1)};function MarkRenderer(a){this._data=a}MarkRenderer.prototype.draw=function(a){if(0!==this._data.points.size()){var b=this._data.points.item(0).x+this._data.offsetX,c=this._data.points.item(0).y+this._data.offsetY;a.translate(-0.5,-0.5);a.drawImage(this._data.image,b,c,this._data.width,this._data.height)}};
|
|
MarkRenderer.prototype.hitTest=function(a){if(0===this._data.points.size())return null;var b=this._data.points.item(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 HitTestResult(HitTestResult.MOVEPOINT):null};
|
|
function W96(a,b,c,d,e,f,g){W89.call(this,a,b);this._image=c;this._offsetX=f||0;this._offsetY=g||0;this._width=d;this._height=e}inherit(W96,W89);W96.prototype.setAnchors=function(a){this._anchorsOffset=a};
|
|
W96.prototype.renderer=function(){var a={};a.points=this._points;a.color=this.D98.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.size()){var b=new CompositeRenderer;b.append(new MarkRenderer(a));if(this._anchorsOffset){for(var c=new List,d=0;d<a.points.size();d++)c.append(a.points.item(d).clone().add(this._anchorsOffset));b.append(new SelectionRenderer({points:c}))}else b.append(new SelectionRenderer({points:a.points}));
|
|
return b}return new MarkRenderer(a)};W96.prototype.update=function(){W89.prototype.update.call(this)};D78.version=2;D78.prototype.state=function(a){for(var b={panes:[]},c=0;c<this.panes().size();c++)b.panes.push(this.panes().item(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=D78.version;b.timezone=this.timezone();return b};
|
|
D78.prototype.asyncState=function(a){return this.publishedChartsTimelineSource().asyncState(a).pipe(function(a){var c={};c.chartProperties={publishedChartsTimelineProperties:a};return c})};
|
|
D78.prototype.restoreState=function(a,b){if(a.panes)if(isArray(a.panes))if(1>a.panes.length)TradingView.logDebug("D78.restoreState: invalid state");else{a.chartProperties&&!a.chartProperties.timezone&&(a.chartProperties.timezone=a.timezone);a.chartProperties&&(this.Z1.paneProperties.merge(a.chartProperties.paneProperties),this.Z1.scalesProperties.merge(a.chartProperties.scalesProperties),a.chartProperties.timezone&&this.Z1.timezone.setValue(a.chartProperties.timezone),
|
|
a.chartProperties.publishedChartsTimelineProperties&&this.publishedChartsTimelineSource().restoreData(a.chartProperties.publishedChartsTimelineProperties,b),this.m_timeScale.restoreState(a.timeScale,b));a.timeScale&&this.m_timeScale.restoreState(a.timeScale,b);var c=a.panes;this.panes().item(0).restoreState(c[0],b,a.version);for(c=1;c<a.panes.length;c++)(this.panes().item(c)||this.createPane()).restoreState(a.panes[c],b,a.version);this._invalidateBarColorerCaches();for(var d=this.Z18(),c=
|
|
0;c<d.size();c++){var e=d.item(c);isInherited(e.constructor,D46)&&e.calcIsActualSymbol()}this._version=a.version;this.timeScale().recalcLockedScale();this.recalculateAllPanes();this.Z19(new Q22(Q22.FULL_UPDATE))}else TradingView.logDebug("D78.restoreState: invalid state");else TradingView.logDebug("D78.restoreState: invalid state")};
|
|
D78.prototype.restoreAxisState=function(a){if(a.panes)if(isArray(a.panes))if(1>a.panes.length)TradingView.logDebug("D78.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().item(b);c.m_leftPriceScale.restoreState(a.panes[b].leftAxisState);c.m_rightPriceScale.restoreState(a.panes[b].rightAxisState)}this.recalculateAllPanes();this.Z19(new Q22(Q22.FULL_UPDATE))}else TradingView.logDebug("D78.restoreAxisState: invalid state");
|
|
else TradingView.logDebug("D78.restoreAxisState: invalid state")};
|
|
D74.prototype.state=function(a,b,c){function d(a){return c&&!a.isSavedInStudyTemplates()||a instanceof TradingView.AlertLabel}var e={};if(a)for(e.sources=[],a=0;a<this.m_dataSources.size();a++)d(this.m_dataSources.item(a))||e.sources.push(this.m_dataSources.item(a).state(b));e.leftAxisState=this.m_leftPriceScale.state();e.leftAxisSources=[];for(a=0;a<this.m_leftPriceScale.Z18().size();a++)d(this.m_leftPriceScale.Z18().item(a))||e.leftAxisSources.push(this.m_leftPriceScale.Z18().item(a).id());
|
|
e.rightAxisState=this.m_rightPriceScale.state();e.rightAxisSources=[];for(a=0;a<this.m_rightPriceScale.Z18().size();a++)d(this.m_rightPriceScale.Z18().item(a))||e.rightAxisSources.push(this.m_rightPriceScale.Z18().item(a).id());e.overlayPriceScales={};for(a=0;a<this.m_dataSources.size();a++)b=this.m_dataSources.item(a),this.isOverlay(b)&&(e.overlayPriceScales[b.id()]=b.priceScale().state());e.stretchFactor=this._stretchFactor;this.m_mainDataSource&&(e.mainSourceId=this.m_mainDataSource.id());
|
|
return e};D74.prototype.sourceById=function(a){for(var b=0;b<this.m_dataSources.size();b++)if(this.m_dataSources.item(b).id()===a)return this.m_dataSources.item(b);return null};
|
|
D74.prototype.restoreState=function(a,b,c){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 d={};if(a.sources){var e=this.m_dataSources.contains(this.D99.mainSeries());this.clearSeries();e&&this.m_dataSources.append(this.D99.mainSeries());for(var f=0;f<a.sources.length;f++){var g=a.sources[f].type,h=a.sources[f].id;d[h]=a.sources[f].ownerSource;
|
|
var k=a.sources[f].state,l=a.sources[f].zorder;if("MainSeries"===g){e||(this.D99.paneForSource(this.D99.mainSeries()).removeDataSource(this.D99.mainSeries()),this.m_dataSources.append(this.D99.mainSeries()));var m=k&&k.style?k.style:void 0,g=m==TradingView.Series.STYLE_PNF&&k.pnfStyle.lockScale;k&&!k.lockScale&&(k.lockScale=g);m==TradingView.Series.STYLE_PNF&&"ATR"==this.D99.mainSeries().properties().pnfStyle.inputs.style.value()?this.D99.mainSeries().properties().pnfStyle.inputs.style._value=
|
|
"Traditional":m==TradingView.Series.STYLE_RENKO&&"ATR"==this.D99.mainSeries().properties().renkoStyle.inputs.style.value()&&(this.D99.mainSeries().properties().renkoStyle.inputs.style._value="Traditional");k&&!k.hasOwnProperty("showSessions")&&(k.showSessions=!1);k&&!k.extendedHours&&(k.extendedHours=!1);this.D99.mainSeries().properties().merge(k);this.D99.mainSeries()._prevChartStyle=this.D99.mainSeries().properties().style.value();this.D99.mainSeries().W62();this.D99.mainSeries().setId(h);
|
|
b&&this.D99.mainSeries().restoreData(a.sources[f].bars,a.sources[f].nsBars,a.sources[f].symbolInfo,a.sources[f].rtPrice,a.sources[f].boxSize);void 0!==l&&this.D99.mainSeries().setZorder(l);this.D99.mainSeries().properties().extendedHours.listeners().fire(this.D99.mainSeries().properties().extendedHours)}else{if(g.toLowerCase().startsWith("study")){var q=TradingView.clone(a.sources[f].metaInfo);$.extend(q,StudyMetaInfo.parseIdString(q.id));var n=k,m=this.D99.studyVersioning(),g=m.patchPropsStateAndMetaInfo(n,
|
|
q),n=g.propsState,q=g.metaInfo,t=m.updateMetaInfo(q),k=t||q;k.isTVScript&&!b&&(g=StudyMetaInfo.parseIdString(k.fullId||k.id),pro.hasPackage(g.productId)||(k=Q57.createScriptStubNoSrc(k.description,"Error: study not authorized!",k.scriptIdPart),$.extend(k,StudyMetaInfo.parseIdString(k.id)),t=q=k,n={}));g=TradingView.prepareStudyPropertiesForLoadChart(q,t,n,null,m);g=TradingView.createStudy(this.D99,g,this.D99.mainSeries(),k);g.setId(h);this.m_dataSources.append(g);b&&(m=m.patchStudyData(q,
|
|
a.sources[f].data,a.sources[f].nonSeriesData,a.sources[f].indexes),g.restoreData(m.data,m.nsData,m.indexes))}else{q=TradingView[g];assert(isInherited(q,D46),"invalid data source type:"+g+" (expected to be a Line Tool)");m=a.sources[f].points;n=!1;for(t=0;t<m.length;t++)if(1E4<Math.abs(m[t].offset)){n=!0;break}if(n)continue;m=null;n=factoryDefaults("linetool");isInherited(q,Q63)?(m=this.D99.studyVersioning(),a.sources[f]=m.patchPointsBasedStudyState(a.sources[f]),
|
|
k=a.sources[f].state,TradingView.merge(n,k),q=a.sources[f].metaInfo,$.extend(q,StudyMetaInfo.parseIdString(q.fullId)),k=(t=m.updateMetaInfo(q))||q,n=TradingView.prepareStudyPropsStateForLoadChart(k,q,n,null,m),b?TradingView.merge(n,{fixedSize:!1}):TradingView.merge(n,{fixedSize:!0}),n=new W51("study_"+k.id,n,!0),g=new TradingView[g](this.D99,n,k)):(q=g.toLowerCase(),TradingView.merge(n,factoryDefaults(q)),TradingView.merge(n,k),b?TradingView.merge(n,{fixedSize:!1}):TradingView.merge(n,
|
|
{fixedSize:!0}),n=new W51(g.toLowerCase(),n),g=new TradingView[g](this.D99,n));g.setId(h);k=a.sources[f].indexes?a.sources[f].indexes:[];k=k.slice(0,a.sources[f].points.length);g.isFixed()?g.restorePositionPercents(a.sources[f].positionPercents):g.restorePoints(a.sources[f].points,k,b);g instanceof TradingView.LineToolBarsPattern||g instanceof TradingView.LineToolCallout||g instanceof TradingView.LineToolTrendAngle||g instanceof TradingView.LineToolParallelChannel?g.restoreData(a.sources[f]):
|
|
b&&g.restoreData&&(k=a.sources[f],m&&(k.graphics=m.patchPointsBasedStudyData(k.metaInfo,k.graphics)),g.restoreData(k));m=null==a.sources[f].version?1:a.sources[f].version;k=null==g.version?1:g.version;m!=k&&"function"===typeof g.migrateVersion&&g.migrateVersion(m,k,{pane:this,model:this.D99,properties:n});this.m_dataSources.append(g)}void 0!==l&&g.setZorder(l)}}}this.m_leftPriceScale.Z18().clear();this.m_leftPriceScale._hasSeries=!1;n=defaults("chartproperties").paneProperties.leftAxisProperties;
|
|
TradingView.merge(n,a.leftAxisState);this.m_leftPriceScale.restoreState(n);for(f=0;f<a.leftAxisSources.length;f++)if(g=this.dataSourceForId(a.leftAxisSources[f]))this.m_leftPriceScale.addDataSource(g),g.setPriceScale(this.m_leftPriceScale);this.m_rightPriceScale.Z18().clear();this.m_rightPriceScale._hasSeries=!1;n=defaults("chartproperties").paneProperties.rightAxisProperties;TradingView.merge(n,a.rightAxisState);this.m_rightPriceScale.restoreState(n);for(f=0;f<a.rightAxisSources.length;f++)if(g=
|
|
this.dataSourceForId(a.rightAxisSources[f]))this.m_rightPriceScale.addDataSource(g),g.setPriceScale(this.m_rightPriceScale);for(f=0;f<this.m_dataSources.size();f++)g=this.m_dataSources.item(f),this.m_rightPriceScale.Z18().contains(g)||this.m_leftPriceScale.Z18().contains(g)?g._isOverlay=!1:(g._isOverlay=!0,b=new D75(this.Z1.overlayPropreties),b.setHeight(this.m_height),b.setTopMargin(this.m_rightPriceScale.topMargin()),b.setBottomMargin(this.m_rightPriceScale.bottomMargin()),
|
|
b.addDataSource(g),a.overlayPriceScales&&a.overlayPriceScales[g.id()]&&(n=a.overlayPriceScales[g.id()],n.m_isAutoScale=!0,n.m_isLog=!1,n.m_isPercentage=!1,b.restoreState(n)),g.setPriceScale(b));for(h in d)(f=d[h])&&(g=this.sourceById(h))&&this.sourceById(h).setOwnerSource(this.sourceById(f));for(f=0;f<this.m_dataSources.size();f++)if(g=this.m_dataSources.item(f),isInherited(g.constructor,PriceDataSource)){this.m_mainDataSource=g;break}for(f=0;f<this.m_dataSources.size();f++)g=this.m_dataSources.item(f),
|
|
isInherited(g.constructor,D46)&&(g.ownerSource()||g.setOwnerSource(this.mainDataSource()),g.isFixed()&&g.restoreFixedPoints(),1==c&&g.priceScale().isPercent()&&!g.isFixed()&&g.correctPricesToPercents(),g.fixAfterRestorePriceAxis&&g.fixAfterRestorePriceAxis());a.mainSourceId&&(this.m_mainDataSource=this.dataSourceForId(a.mainSourceId));this._updateMargins();this._cachedHitTestSources=this._cachedOrderedSoruces=null};
|
|
D78.prototype.studyTemplate=function(a){for(var b={panes:[]},c=0;c<this.panes().size();c++)b.panes.push(this.panes().item(c).state(!0,!1,!0));a&&(b.interval=this.mainSeries().interval());b.version=D78.version;return b};D78.prototype.restoreStudyTemplate=function(a,b){this._undoModel.studyLoadTemplate(this._undoModel,this.studyTemplate(),a,b)};
|
|
D78.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=
|
|
D78.version;return a};D78.prototype.restoreTheme=function(a){var b={hollowCandle:{related:"candle"}},c;for(c in b)if(!a.mainSourceProperties[c+"Style"]){var d=a.mainSourceProperties[c+"Style"]=factoryDefaults("chartproperties.mainSeriesProperties."+c+"Style"),e=a.mainSourceProperties[b[c].related+"Style"],f;for(f in e)f in d&&(d[f]=e[f])}this._undoModel.chartLoadTheme(this,a)};function fixLineToolsPositions(a,b,c){var d=a.allLineTools(),e=d.size();a=a.timeScale();a.points();for(var f=0;f<e;++f){for(var g=d.item(f),h=0,k=g.points(),l=k.size(),m=0;m<l;++m){var q=k.item(m);q.time>b&&q.time<=c&&(q.index=a.m_points.indexOf(q.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[TIME_PLOT],n=c.params.plots;a._haveNoMoreData=
|
|
n.length<l;k=0==n.length;m=f==g;e.mainSeries().fixLastBar();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.Z18();
|
|
for(var q={},s=0;s<c.size();s++){var A=c.item(s);if(isInherited(A.constructor,TradingView.Study)&&-1!==["Volume","Compare","Overlay","Sessions"].indexOf(A.metaInfo().shortId)){var B="study_"+s,w=A.metaInfo().id+"-1!";q[B]=A;d++;a._currentRequest.createStudy(B,"turnaround","series_id",w,A.inputs(),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||(q[c.params.customId].m_data.addTail(c.params.plots,
|
|
m),e.model().recalculateAllPanes(),e.model().updateSource(e.mainSeries()))})}}}var e=a.model(),f=e.mainSeries().interval(),g=e.mainSeries().bars().last().value[TIME_PLOT];"function"!==typeof b&&(b=new Function);if(null!=a._currentRequest)TradingView.logDebug("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,q=new TVChartApi;!window.user||"pro_realtime"!==
|
|
user.pro_plan&&"pro_realtime_trial"!==user.pro_plan||q.authTokenRequired(!0);a._currentRequest=new ChartSession(q);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)}}})}}};function FutureBarsRenderer(a){this._data=a}FutureBarsRenderer.prototype.hitTest=function(){return null};FutureBarsRenderer.prototype.draw=function(a){a.fillStyle="rgba(195,255,160, 0.3)";a.fillRect(Math.max(0,this._data.x),0,this._data.width,this._data.height);a.strokeStyle="#308020";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.W78=function(a,b){this._series=a;this._lastBar=b};TradingView.W78.prototype.update=function(){this._x=this._series.m_model.timeScale().indexToCoordinate(this._lastBar)-0.5*this._series.m_model.timeScale().barSpacing()+1};TradingView.W78.prototype.renderer=function(){var a={x:this._x,height:this._series.priceScale().height(),width:this._series.m_model.timeScale().width()};return new FutureBarsRenderer(a)};function D95(a,b){var c=a._undoModel.Z3,d=c.onWidget(),e=!1,e=d?c._options&&!c._options.hideIdeas:TVSettings.getBool("D95.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("D95.visibile",!!a.value());f._tooltip&&f._tooltip.removeAll()});D46.call(this,a,null,b);this.onNeedRepaint=new Delegate;this._requests=
|
|
[];this._marks={};this._collectedRange=this._getDataTimeout=this._loadedRange=null;this.D99.mainSeries().onSymbolIntervalChanged().subscribe(this,this.getNewData);this.D99.mainSeries().onSymbolResolved().subscribe(this,this.getNewData);this.D99.mainSeries().onTickmarksRangeChanged().subscribe(this,this.getData);this._initialize();this.pinnedTooltips={};this._tooltip=new TooltipRenderer(this._createTooltip.bind(this),this)}inherit(D95,D46);
|
|
D95.prototype._constructor="Child class must override this member";D95.prototype._initialize=function(a){throw"Child class must override this member";};D95.prototype.onClicked=function(){throw"Child class must override this member";};D95.prototype._getData=function(a){throw"Child class must override this member";};D95.prototype._createTooltip=function(){throw"Child class must override this member";};
|
|
D95.prototype.updateDotData=function(a,b){return b};D95.prototype.updatePlateData=function(a,b){};D95.prototype._plateViewData=function(a){return{}};D95.prototype.pinTooltip=function(a,b){this.pinnedTooltips[a]=b};D95.prototype.timeScale=function(){return this.D99.timeScale()};
|
|
D95.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.D99.mainSeries().properties().interval.value();switch(e){case "M":return d;case "W":return c;case "D":return b;default:return a(e)}};D95.prototype._maxDate=new Date(2037,0,1);
|
|
D95.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};end=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:end};return{start:a.start?a.start.getTime()/1E3:void 0,end:a.end?a.end.getTime()/1E3:void 0}};D95.prototype.getVisibleRangePlates=function(){var a=[],b=this.getVisibleTickmarksRange(),c=this.getIntervalInTicks();$.each(this._marks,function(d,e){e.tickmark>=b.start&&e.tickmark<=b.end+c&&a.push(e)});return a};
|
|
D95.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};D95.prototype._maxPlatesPerBar=10;
|
|
D95.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)},[])};D95.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"}};
|
|
D95.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"}};D95.prototype._offset=function(a,b){var c;switch(a){default:case "up":c=b[HIGH_PLOT];break;case "down":c=b[LOW_PLOT]}this.priceScale().isPercent()&&(c=this.priceScale().priceRange().convertToPercent(c,this.ownerSource().firstValue()));return this.priceScale().priceToCoordinate(c)};
|
|
D95.prototype._getIndex=function(a){return this.timeScale().points().closestIndexLeft(a)};D95.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}};D95.prototype.barWidth=function(){return this.timeScale().barSpacing()};
|
|
D95.prototype.getPlatesViewData=function(){if(this.D99.mainSeries().data().isEmpty())return[];var a=this.filterDisplayedPlates(this.getVisibleRangePlates()),b=this,c={},d=this.D99.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),q=d&&d.id==a.id,n=this.timeScale().indexToCoordinate(e),f=this._offset(l,f),t=0;e in c||(c[e]={up:0,down:0});t=c[e][l]++;return TradingView.merge({id:a.id,
|
|
x:n,y:f,order:t,direction:l,theme:m,hovered:q,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};D95.prototype._getBar=function(a){return this.D99.mainSeries().data().valueAt(a)};
|
|
D95.prototype.paneViews=function(a){var b=this;return this.Z1.visible.value()?(new List).append(new W58(this,a,function(a){return new BarsMarksContainerRenderer(a.getViewData(),b)})):new List};D95.prototype.dataWindowView=function(){return null};D95.prototype.priceAxisViews=function(){return null};D95.prototype.statusView=function(){return null};D95.prototype.updateAllViews=function(){};
|
|
D95.prototype.pointsCount=function(){return 0};D95.prototype.properties=function(){return this.Z1};D95.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};
|
|
D95.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};
|
|
D95.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)};D95.prototype.roundRange=function(a){return{start:Math.round(a.start),end:Math.round(a.end)}};
|
|
D95.prototype.getData=function(a){if(!a.start||!a.end)throw new TypeError("Wrong range");a=$.extend({},a);a.end=this._maxDate/1E3;this._pushGetDataStack(a)};D95.prototype._abortAllRequests=function(){this._requests.forEach(function(a){a.abort()});this._requests=[];this._getDataTimeout&&clearTimeout(this._getDataTimeout);this._getDataTimeout=this._collectedRange=null};
|
|
D95.prototype.getNewData=function(){this._abortAllRequests();this._marks={};this._loadedRange=null};function W58(a,b,c){this.source=a;this.pane=b;this._rendererFactory=c}W58.prototype.update=function(){};W58.prototype.renderer=function(){return this._rendererFactory(this.source)};function BarsMarksContainerRenderer(a,b){this._barWidth=a.barWidth;this._plates=a.plates;this._tooltip=a.tooltip;this.D99=b}
|
|
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()};
|
|
BarsMarksContainerRenderer.prototype._drawItem=function(a,b){a.save();this._highlightByAuthor&&!b.highlightByAuthor&&(a.globalAlpha=0.4);var c=this._dotTransform(b);c.mine?this._drawTriangle(a,c):this._drawDot(a,c);a.restore()};
|
|
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+0.6)+0.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}};
|
|
BarsMarksContainerRenderer.prototype._dotTransform=function(a){var b=this._commonTransform(a);b.radius=Math.max(a.minSize/2,0.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.D99.updateDotData(a,b)};BarsMarksContainerRenderer.prototype._plateTransform=function(a){var b=this._commonTransform(a);return this.D99.updatePlateData(a,b)};BarsMarksContainerRenderer.THEMES=["green","red","neutral","yellow","blue"];
|
|
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}};BarsMarksContainerRenderer.THEMES.forEach(function(a){var b=BarsMarksContainerRenderer.prototype.themes;b[a+"_hovered"]=$.extend({},b[a],{dotBorderWidth:4})});
|
|
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()};
|
|
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))};
|
|
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};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 HitTestResult(HitTestResult.REGULAR,a):null};function D96(){this._layout=[];this._currentId=void 0;this.tooltipHovered=!1}
|
|
D96.prototype._createLayout=function(){throw"Child class must override this member";};D96.prototype._updatePlate=function(a){throw"Child class must override this member";};D96.prototype._getContainer=function(a){this._container&&this._context===a||(this._context=a,this._container=$(a.canvas).parent());return this._container};D96.prototype._plateArrowSize=14;
|
|
D96.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);this._layout.toggleClass("right",e);this._layout.css({top:a.y,right:f,fontSize:d+"px",display:"block"})};D96.prototype._removeLayout=function(){this.tooltipHovered||(this._layout.stop(!0),this._layout.remove())};D96.prototype._toggleLayout=function(a){this._layout.toggle(a)};
|
|
D96.prototype.hide=function(a){this.tooltipHovered?this._layout.stop(!0).fadeTo(0,1):this._layout.fadeOut(400,function(){$(this).remove();a()})};D96.prototype.setSource=function(a){this.source=a};TooltipRenderer=function(a,b){this.tooltips={};this.tooltipFactory=a;this.source=b};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};
|
|
TooltipRenderer.prototype.showPlate=function(a,b){var c=this.findOrCreateTooltip(a);null!=c&&(c._drawPlate(a,b),c.plateData=a)};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))};
|
|
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])}};TooltipRenderer.prototype.removeAll=function(){for(var a in this.tooltips)this.tooltips.hasOwnProperty(a)&&this.tooltips[a].remove();this.tooltips={}};TooltipRenderer.prototype.removeTooltip=function(a){delete this.tooltips[a]};
|
|
TooltipRenderer.prototype._createTooltip=function(){return new TooltipWrap(this,this.tooltipFactory())};TooltipWrap=function(a,b){this.renderer=a;this._tooltip=b;this.visible=!1};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)})};TooltipWrap.prototype.remove=function(){this._tooltip._removeLayout()};
|
|
TooltipWrap.prototype.toggleVisibility=function(){this._tooltip._toggleLayout(this.visible);this.visible=!1};function UserDefinedBarsMarks(a){D95.call(this,a)}inherit(UserDefinedBarsMarks,D95);UserDefinedBarsMarks.prototype._initialize=function(a){this.Z1.visible.setValue(!0)};UserDefinedBarsMarks.prototype._constructor="UserDefinedBarsMarks";UserDefinedBarsMarks.prototype._plateViewData=function(a){return{text:a.text}};UserDefinedBarsMarks.prototype.onClicked=function(){var a=this.D99.lastHittestData().id;this._marks[a].onClicked()};
|
|
UserDefinedBarsMarks.prototype._getData=function(a){var b=this.D99.mainSeries().symbolInfo();if(b){var c=this.roundRange(this._rangeDifference(a)),d=this,e=this.D99.mainSeries().properties().interval.value();Z15.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)}};UserDefinedBarsMarks.prototype._createTooltip=function(){return new UserDefinedBarsMarksTooltip};
|
|
UserDefinedBarsMarks.prototype.updatePlateData=function(a,b){b.barWidth=this.barWidth();b.text=a.text;b.tooltipMargin=-1*Math.max(a.minSize/2,0.4*this.barWidth());return b};UserDefinedBarsMarks.prototype.hasContextMenu=function(){return!1};function UserDefinedBarsMarksTooltip(a){D96.call(this)}inherit(UserDefinedBarsMarksTooltip,D96);UserDefinedBarsMarksTooltip.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>');this._layout_text=$('<div class="text"></div>').appendTo(this._layout)};
|
|
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)};function D31(a,b){this.D98=a;this.D99=b;this._points=(new List).append(new MathEx.Point(0,0))}D31.prototype.update=function(){this._visible=!1;if(this.D98.properties().showPriceLine.value()){var a=this.D98.lastValueData("close",!0);a&&(this._visible=!0,this._points=(new List).append(new MathEx.Point(0,a.coordinate)),this._color=a.color)}};
|
|
D31.prototype.renderer=function(){var a={};a.points=this._points;a.color=this._color;a.linewidth=1;a.linestyle=CanvasEx.LINESTYLE_DOTTED;a.hitTestResult=HitTestResult.REGULAR;a.visible=this._visible;return new HorzLineRenderer(a)};Q50=function(a,b){this.D98=a;this.D99=b;this._invalidated=!0;this._text="";this._coordinate=0;this._background="black";this._color="white";this._textHeight=14};inherit(Q50,PriceAxisView);
|
|
Q50.prototype.update=function(){this._invalidated=!0};Q50.prototype._updateImpl=function(){this._visible=!1;this._text="";var a=this.D98.lastValueData("close",!1);a&&(this._text=a.text,this._coordinate=a.coordinate,this._textHeight=this.D98.priceScale().m_markBuilder.fontHeight(),this._background=a.color,this._visible=!0)};
|
|
Q50.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 PriceAxisViewRenderer(a)};
|
|
Q49=function(a,b){DataWindowView.call(this);this.Z0=a;this.D99=b;this._items.append(new DataWindowItem("Open",""));this._items.append(new DataWindowItem("High",""));this._items.append(new DataWindowItem("Low",""));this._items.append(new DataWindowItem("Close",""));this._invalidated=!0;this.update()};inherit(Q49,DataWindowView);
|
|
Q49.prototype._updateImpl=function(){this._header=this.Z0.title();if(!this.D99.timeScale().isEmpty()&&0!==this.Z0.data().size()){var a,b,c=!1;this.Z0.properties().style.value()===TradingView.Series.STYLE_BARS?(a=this.Z0.properties().barStyle.upColor.value(),b=this.Z0.properties().barStyle.downColor.value(),c=this.Z0.properties().barStyle.barColorsOnPrevClose.value()):this.Z0.properties().style.value()===TradingView.Series.STYLE_CANDLES?
|
|
(a=this.Z0.properties().candleStyle.upColor.value(),b=this.Z0.properties().candleStyle.downColor.value(),c=this.Z0.properties().candleStyle.barColorsOnPrevClose.value()):this.Z0.properties().style.value()===TradingView.Series.STYLE_HOLLOW_CANDLES?(a=this.Z0.properties().hollowCandleStyle.upColor.value(),b=this.Z0.properties().hollowCandleStyle.downColor.value(),c=!0):this.Z0.properties().style.value()===TradingView.Series.STYLE_LINE?a=b=this.Z0.properties().lineStyle.color.value():
|
|
this.Z0.properties().style.value()===TradingView.Series.STYLE_AREA&&(a=b=this.Z0.properties().areaStyle.linecolor.value());var d=this.Z0.series(),e=this.D99.crossHairSource().index,d=d.nearestIndex(e,SEARCH_NEAREST_LEFT);if(void 0!==d){e=this.Z0.data().valueAt(d);if(!(e&&e[OPEN_PLOT]&&e[HIGH_PLOT]&&e[LOW_PLOT]&&e[CLOSE_PLOT]))return;var f=this.Z0.formatter();this._items.item(0).setValue(f.format(e[OPEN_PLOT]));this._items.item(1).setValue(f.format(e[HIGH_PLOT]));this._items.item(2).setValue(f.format(e[LOW_PLOT]));
|
|
this._items.item(3).setValue(f.format(e[CLOSE_PLOT]));a=c&&1<=d?this.Z0.data().valueAt(d-1)[CLOSE_PLOT]<=e[CLOSE_PLOT]?a:b:e[OPEN_PLOT]<=e[CLOSE_PLOT]?a:b;for(b=0;4>b;b++)this._items.item(b).setColor(a)}this._additional=(a=TradingView.getDataVendorString(this.Z0.symbolInfo()))?"(Data Provided by "+a+")":void 0}};Q49.prototype.items=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);return this._items};
|
|
Q49.prototype.update=function(){this._invalidated=!0};Q49.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.D37(a,this,"close");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.D99.Z19(new Q22(Q22.FULL_UPDATE))})};inherit(TradingView.study_Overlay,TradingView.Study);
|
|
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[OPEN_PLOT]<=e[CLOSE_PLOT]?d.barStyle.upColor.value():d.barStyle.downColor.value();break;case TradingView.Series.STYLE_CANDLES:c.color=e[OPEN_PLOT]<=e[CLOSE_PLOT]?d.candleStyle.upColor.value():d.candleStyle.downColor.value();break;case TradingView.Series.STYLE_HOLLOW_CANDLES:c.color=
|
|
e[OPEN_PLOT]<=e[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=new List;this._priceAxisViewsBase=new List;this._priceAxisViewsBase.append(new Q50(this,this.D99));this._paneViews=new List;paneView=null;switch(this.Z1.style.value()){case TradingView.Series.STYLE_BARS:paneView=new D14(this,this.D99);break;case TradingView.Series.STYLE_CANDLES:paneView=new D15(this,this.D99);break;case TradingView.Series.STYLE_HOLLOW_CANDLES:paneView=
|
|
new D17(this,this.D99);break;case TradingView.Series.STYLE_LINE:paneView=new D19(this,this.Z1.lineStyle.priceSource.value(),this.D99);break;case TradingView.Series.STYLE_AREA:paneView=new D12(this,this.Z1.areaStyle.priceSource.value(),this.D99)}this._paneViews.append(paneView);this._paneViews.append(new D31(this,this.D99));this._paneViews.append(this._symbolLabelView);this._dataWindowView||
|
|
(this._dataWindowView=new Q49(this,this.D99));this._statusView||(this._statusView=new StudyStatusView(this));this._priceAxisViews=(new List).appendAll(this._priceAxisViewsBase).appendAll(this._hlinesPriceAsisViews).appendAll(this._horizlinesPriceAsisViews)};TradingView.study_Overlay.prototype.barColorer=function(){return new 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 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 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)[OPEN_PLOT]};TradingView.study_Overlay.prototype.high=function(a){return this.bars().valueAt(a)[HIGH_PLOT]};TradingView.study_Overlay.prototype.low=function(a){return this.bars().valueAt(a)[LOW_PLOT]};TradingView.study_Overlay.prototype.close=function(a){return this.bars().valueAt(a)[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.Z1.inputs.symbol.value();return a?this._resolvedSymbols[a]:null};TradingView.Study.graphicsZOrderPriority=function(a){switch(a){case "polygons":return-100;default:return 0}};TradingView.Study.StudyPaneView_horizlines=function(a,b){this.Z0=a;this.D99=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 CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TrendLineRenderer(this._data[b],new HitTestResult(HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_horizlines.prototype._updateViewInternal=function(){this._data=[];var a=this.Z0.graphics().horizlines;if(a){var b=this.Z0.priceScale(),c=this.Z0.D99.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.Z0.firstValue(),e=this.Z0.graphics().indexes,f=this.D99.timeScale().visibleBars(),g=f.firstBar(),f=f.lastBar(),h=0;h<a.length;h++){var k=a[h];if(k.data){var l=this.Z0.properties().graphics.horizlines[k.styleId];if(l.visible.value())for(var m=
|
|
0;m<k.data.length;m++){var q=k.data[m],n=e[q.startIndex],t=e[q.endIndex];if(!(!q.extendRight&&Math.max(n,t)<g||!q.extendLeft&&Math.min(n,t)>f)){var u={},n=c.indexToCoordinate(n),t=c.indexToCoordinate(t),z=q.level;b.isPercent()&&(z=b.priceRange().convertToPercent(z,d));z=b.priceToCoordinate(z);n=new MathEx.Point(n,z);t=new MathEx.Point(t,z);u.points=(new List).append(n).append(t);u.extendleft=q.extendLeft;u.extendright=q.extendRight;u.width=c.width();u.height=b.height();u.color=l.color.value();u.linewidth=
|
|
l.width.value();u.linestyle=l.style.value();this._data.push(u)}}}}}};TradingView.Study.StudyPaneView_vertlines=function(a,b){this.Z0=a;this.D99=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 CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TrendLineRenderer(this._data[b],new HitTestResult(HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_vertlines.prototype._updateViewInternal=function(){this._data=[];var a=this.Z0.graphics().vertlines;if(a){var b=this.Z0.priceScale(),c=this.Z0.D99.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.Z0.firstValue(),e=this.Z0.graphics().indexes,f=this.D99.timeScale().visibleBars(),g=f.firstBar(),f=f.lastBar(),h=0;h<a.length;h++){var k=a[h];if(k.data){var l=this.Z0.properties().graphics.vertlines[k.styleId];if(l.visible.value())for(var m=
|
|
0;m<k.data.length;m++){var q=k.data[m],n={};if(!(e[q.index]<g||e[q.index]>f)){var t=c.indexToCoordinate(e[q.index])+1,u=q.startPrice,z=q.endPrice,s=b.priceRange();q.extendBottom&&(u=s.minValue());q.extendTop&&(z=s.maxValue());b.isPercent()&&(u=b.priceRange().convertToPercent(u,d),z=b.priceRange().convertToPercent(z,d));u=b.priceToCoordinate(u);z=b.priceToCoordinate(z);u=new MathEx.Point(t,u);t=new MathEx.Point(t,z);n.points=(new List).append(u).append(t);n.extendleft=q.extendBottom;n.extendright=
|
|
q.extendTop;n.width=c.width();n.height=b.height();n.color=l.color.value();n.linewidth=l.width.value();n.linestyle=l.style.value();this._data.push(n)}}}}}};TradingView.Study.StudyPaneView_lines=function(a,b){this.Z0=a;this.D99=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 CompositeRenderer,b=0;b<this._data.length;b++)a.append(new TrendLineRenderer(this._data[b],new HitTestResult(HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_lines.prototype._updateViewInternal=function(){this._data=[];var a=this.Z0.graphics().lines;if(a){var b=this.Z0.priceScale(),c=this.Z0.D99.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.Z0.firstValue(),e=this.Z0.graphics().indexes,f=this.D99.timeScale().visibleBars(),g=f.firstBar(),f=f.lastBar(),h=0;h<a.length;h++){var k=a[h];if(k.data){var l=this.Z0.properties().graphics.lines[k.styleId];if(l.visible.value())for(var m=
|
|
0;m<k.data.length;m++){var q=k.data[m],n=e[q.startIndex]+(q.startOffset||0),t=e[q.endIndex]+(q.endOffset||0);if(!(!q.extendRight&&Math.max(n,t)<g||!q.extendLeft&&Math.min(n,t)>f)){var u={},n=c.indexToCoordinate(n),t=c.indexToCoordinate(t),z=q.startPrice,q=q.endPrice;b.isPercent()&&(z=b.priceRange().convertToPercent(z,d),q=b.priceRange().convertToPercent(q,d));z=b.priceToCoordinate(z);q=b.priceToCoordinate(q);n=new MathEx.Point(n,z);t=new MathEx.Point(t,q);u.points=(new List).append(n).append(t);u.color=
|
|
l.color.value();u.linewidth=l.width.value();u.linestyle=l.style.value();this._data.push(u)}}}}}};TradingView.Study.StudyPaneView_hlines=function(a,b){this.Z0=a;this.D99=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 CompositeRenderer,b=0;b<this._data.length;b++)a.append(new HorzLineRenderer(this._data[b]));for(b=0;b<this._textData.length;b++)a.append(new TextRenderer(this._textData[b],this._textRendererCache,new HitTestResult(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.Z0.graphics().hlines;if(a){var b=this.Z0.priceScale(),c=this.Z0.D99.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.Z0.firstValue(),e=0;e<a.length;e++){var f=a[e];if(f.data){var g=this.Z0.properties().graphics.hlines[f.styleId];if(g.enableText.value()&&g.showText.value())for(var h=0;h<f.data.length;h++){var k=f.data[h],l={};l.text=void 0===k.text?"":k.text;l.color=
|
|
g.color.value();l.font="arial";l.fontsize=g.fontSize.value();k=k.level;b.isPercent()&&(k=b.priceRange().convertToPercent(k,d));k=b.priceToCoordinate(k);tp=g.textPos.value();var m;if(tp==CanvasEx.TEXTPOS_TOPLEFT||tp==CanvasEx.TEXTPOS_MIDDLELEFT||tp==CanvasEx.TEXTPOS_BOTTOMLEFT)m=4,l.horzAlign="left";else if(tp==CanvasEx.TEXTPOS_TOPCENTER||tp==CanvasEx.TEXTPOS_MIDDLECENTER||tp==CanvasEx.TEXTPOS_BOTTOMCENTER)m=c.width()/2,l.horzAlign="center";else if(tp==CanvasEx.TEXTPOS_TOPRIGHT||tp==CanvasEx.TEXTPOS_MIDDLERIGHT||
|
|
tp==CanvasEx.TEXTPOS_BOTTOMRIGHT)m=c.width(),l.horzAlign="right";if(tp==CanvasEx.TEXTPOS_TOPLEFT||tp==CanvasEx.TEXTPOS_TOPCENTER||tp==CanvasEx.TEXTPOS_TOPRIGHT)l.vertAlign="bottom",k-=4;else if(tp==CanvasEx.TEXTPOS_MIDDLELEFT||tp==CanvasEx.TEXTPOS_MIDDLECENTER||tp==CanvasEx.TEXTPOS_MIDDLERIGHT)l.vertAlign="middle",k-=2;else if(tp==CanvasEx.TEXTPOS_BOTTOMLEFT||tp==CanvasEx.TEXTPOS_BOTTOMCENTER||tp==CanvasEx.TEXTPOS_BOTTOMRIGHT)l.vertAlign="top";p1=new MathEx.Point(m,k);l.points=(new List).append(p1);
|
|
l.offsetX=0;l.offsetY=0;this._textData.push(l)}}}}};
|
|
TradingView.Study.StudyPaneView_hlines.prototype._calcHorzLinesData=function(){this._data=[];var a=this.Z0.graphics().hlines;if(a){var b=this.Z0.priceScale();if(b&&!b.isEmpty())for(var c=this.Z0.firstValue(),d=0;d<a.length;d++){var e=a[d];if(e.data){var f=this.Z0.properties().graphics.hlines[e.styleId];if(f.visible.value())for(var g=0;g<e.data.length;g++){var h={},k=e.data[g].level;b.isPercent()&&(k=b.priceRange().convertToPercent(k,c));k=b.priceToCoordinate(k);h.points=(new List).append(new MathEx.Point(0,
|
|
k));h.color=f.color.value();h.linewidth=f.width.value();h.linestyle=f.style.value();h.hitTestResult=HitTestResult.REGULAR;this._data.push(h)}}}}};TradingView.Study.StudyPriceAxisView_hlines=function(a,b,c,d,e){this.Z0=a;this.D99=b;this._line=c;this._styleId=d;this._data={};this._lineType=e};inherit(TradingView.Study.StudyPriceAxisView_hlines,PriceAxisView);
|
|
TradingView.Study.StudyPriceAxisView_hlines.prototype.update=function(){this._data={};this._data.visible=!1;var a=this.Z0.priceScale();if(a&&!a.isEmpty()&&this.Z0.properties().visible.value()){var b=this.Z0.properties().graphics[this._lineType][this._styleId];if(b.visible&&b.visible.value()&&b.showPrice&&b.showPrice.value()){var c=this.Z0.firstValue();this._data.visible=!0;this._data.color="white";this._data.background=b.color.value();b=this._line.level;if(a.isPercent()){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(){return new PriceAxisViewRenderer(this._data)};function TriangleTextMarkRenderer(a,b){this._data=a;this._textCache=b}
|
|
TriangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font};
|
|
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=0.65*f,h=1*f;a.save();a.translate(c+0.5,d+0.5);a.beginPath();a.moveTo(0,0);switch(this._data.direction){case "up":case "down":a.lineTo(g,
|
|
h*b);a.lineTo(0.5*e+g,h*b);a.lineTo(0.5*e+g,(h+1.75*f)*b);a.lineTo(0.5*-e-g,(h+1.75*f)*b);a.lineTo(0.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,0.5*-e,0>b?b*h-0.5*f:h+1.25*f);break;default:throw this._data.direction+" doesn't supported by TriangleTextMarkRenderer";}a.restore()}};
|
|
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=0.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+0.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-0.5*b-e,l),new MathEx.Point(k,f)))return new HitTestResult(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+0.65*c;b[1].y=this._data.point.y+c*d;b[2]={};b[2].x=this._data.point.x-0.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 HitTestResult(HitTestResult.REGULAR);break;default:throw this._data.direction+" doesn't supported by TriangleTextMarkRenderer";
|
|
}return null};function RectangleTextMarkRenderer(a,b){this._data=a;this._textCache=b}RectangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font};
|
|
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+0.5,c+0.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()}};RectangleTextMarkRenderer.prototype.hitTest=function(a){var b=this._data.point.x+0.5,c=this._data.point.y+0.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 HitTestResult(HitTestResult.REGULAR):null};
|
|
function CircleShapeMarkRenderer(a,b){this._data=a;this._textCache=b}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+0.5,this._data.size,0,2*Math.PI);a.closePath();a.fill();a.stroke()}};
|
|
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+0.5-a.x,2)+Math.pow(this._data.point.y+0.5+2*this._data.size*b-a.y,2)<=Math.pow(this._data.size,2)?new HitTestResult(HitTestResult.REGULAR):null};function SquareShapeMarkRenderer(a,b){this._data=a;this._textCache=b}
|
|
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()}};
|
|
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 HitTestResult(HitTestResult.REGULAR):null};
|
|
function ArrowShapeMarkRenderer(a,b,c){this._data=a;this._textCache=b;this._arrowDirection=c}
|
|
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=0.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()}};
|
|
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=0.6666666*e;switch(d){case "up":var m=new MathEx.Point(b,c),q=new MathEx.Point(b+f,c+l),n=new MathEx.Point(b-f,c+l);break;case "down":m=new MathEx.Point(b,c+e);q=new MathEx.Point(b+f,c+k);n=new MathEx.Point(b-f,c+k);break;case "right":m=new MathEx.Point(b+g,c);q=new MathEx.Point(b-
|
|
g,c-h);n=new MathEx.Point(b-g,c+h);break;case "left":m=new MathEx.Point(b-g,c),q=new MathEx.Point(b+g,c-h),n=new MathEx.Point(b+g,c+h)}return MathEx.pointInTriangle(m,q,n,a)?new HitTestResult(HitTestResult.REGULAR):null};TradingView.Study.StudyPaneView_textmarks=function(a,b){this.Z0=a;this.D99=b;this._data=[];this._textCache=[]};inherit(TradingView.Study.StudyPaneView_textmarks,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 CompositeRenderer,b=0;b<this._data.length;b++)switch(this._data[b].shape){case "triangle":a.append(new TriangleTextMarkRenderer(this._data[b],this._textCache[b]));break;case "rectangle":a.append(new RectangleTextMarkRenderer(this._data[b],this._textCache[b]))}return a};
|
|
TradingView.Study.StudyPaneView_textmarks.prototype._updateViewInternal=function(){this._data=[];var a=this.Z0.graphics().textmarks;if(a){var b=this.Z0.priceScale(),c=this.D99.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.Z0.graphics().indexes,e=this.Z0.firstValue(),f=this.D99.timeScale().visibleBars(),g=f.firstBar(),f=f.lastBar(),h=0;h<a.length;h++){var k=a[h];if(k.data){var l=this.Z0.properties().graphics.textmarks[k.styleId];if(l.visible.value())for(var k=
|
|
k.data,m=0;m<k.length;m++){var q=k[m],n={},t=l.location.value(),u=l.shape.value(),z=d[q.time];if(!(z<g||z>f)&&this.Z0.series().bars().valueAt(z)){z=d[q.time]+(q.offset||0);n.font=l.fontFamily.value();n.color=generateColor(l.color.value(),l.transparency.value());n.bold=l.fontBold.value();n.fontColor=generateColor(l.fontColor.value(),l.transparency.value());n.italic=l.fontItalic.value();n.fontSize=l.fontSize.value();n.text=q.text?q.text:"";n.halign=l.halign.value();n.valign=void 0!=l.valign?l.valign.value():
|
|
"middle";n.shape=l.shape.value();n.size=0.5*c.barSpacing();n.borderColor="rgb(0, 0, 0)";var s=Math.round(c.indexToCoordinate(z)),A;switch(u){case "triangle":A=this._calcXYForTriangleShape(t,z,50,q.price,e,b);n.direction=A.direction;break;case "rectangle":A=this._calcXYForRectangleShape(t,z,q.price,e,b)}n.point=new MathEx.Point(s,A.y);this._data.push(n);this._textCache.push({})}}}}}};
|
|
TradingView.Study.StudyPaneView_textmarks.prototype._calcXYForTriangleShape=function(a,b,c,d,e,f){switch(a){case CanvasEx.MARKLOC_TOP:a=f.height()-c;b="down";break;case CanvasEx.MARKLOC_BOTTOM:a=c;b="up";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:f.isPercent()&&(d=f.priceRange().convertToPercent(d,e));a=f.priceToCoordinate(d);b="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:f.isPercent()&&(d=f.priceRange().convertToPercent(d,e));a=f.priceToCoordinate(d);b="up";break;case CanvasEx.MARKLOC_ABOVEBAR:a=
|
|
this._locationToY(a,b);b="down";break;case CanvasEx.MARKLOC_BELOWBAR:a=this._locationToY(a,b);b="up";break;default:a=this._locationToY(a,b),b="up"}return{y:a,direction:b}};
|
|
TradingView.Study.StudyPaneView_textmarks.prototype._calcXYForRectangleShape=function(a,b,c,d,e){switch(a){case CanvasEx.MARKLOC_ABSOLUTEDOWN:case CanvasEx.MARKLOC_ABSOLUTEUP:case CanvasEx.MARKLOC_ABSOLUTE:e.isPercent()&&(c=e.priceRange().convertToPercent(c,d));a=e.priceToCoordinate(c);break;case CanvasEx.MARKLOC_ABOVEBAR:a=this._locationToY(a,b);break;case CanvasEx.MARKLOC_BELOWBAR:a=this._locationToY(a,b);break;default:a=this._locationToY(a,b)}return{y:a}};
|
|
TradingView.Study.StudyPaneView_shapemarks=function(a,b){this.Z0=a;this.D99=b;this._data=[];this._textCache=[]};inherit(TradingView.Study.StudyPaneView_shapemarks,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 CompositeRenderer,b=0;b<this._data.length;b++)switch(this._data[b].shape){case "circle":a.append(new CircleShapeMarkRenderer(this._data[b],this._textCache[b]));break;case "square":a.append(new SquareShapeMarkRenderer(this._data[b],this._textCache[b]));break;case "arrowUp":a.append(new ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"up"));
|
|
break;case "arrowDown":a.append(new ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"down"));break;case "arrowRight":a.append(new ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"right"));break;case "arrowLeft":a.append(new ArrowShapeMarkRenderer(this._data[b],this._textCache[b],"left"))}return a};
|
|
TradingView.Study.StudyPaneView_shapemarks.prototype._updateViewInternal=function(){this._data=[];var a=this.Z0.graphics().shapemarks;if(a){var b=this.Z0.priceScale(),c=this.D99.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.Z0.graphics().indexes,e=this.D99.timeScale().visibleBars(),f=e.firstBar(),e=e.lastBar(),g=0;g<a.length;g++){var h=a[g];if(h.data){var k=this.Z0.properties().graphics.shapemarks[h.styleId];if(k.visible.value())for(var h=h.data,l=0;l<h.length;l++){var m=
|
|
h[l],q=d[m.time];if(!(q<f||q>e)){var n={};if(null!=m.time&&this.Z0.series().bars().valueAt(q)){n.color=generateColor(k.color.value(),k.transparency.value());var t=0;"left"==k.halign.value()?t-=c.barSpacing()/2+1:"right"==k.halign.value()&&(t+=c.barSpacing()/2+1);n.size=k.size.value();n.shape=k.shape.value();var t=Math.round(c.indexToCoordinate(q))+t,u=this.Z0.firstValue(),m=m.price;b.isPercent()&&(m=b.priceRange().convertToPercent(m,u));m=b.priceToCoordinate(m);u=k.location.value();switch(u){case CanvasEx.MARKLOC_ABSOLUTE:n.direction=
|
|
"";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:n.direction="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:n.direction="up";break;case CanvasEx.MARKLOC_ABOVEBAR:m=this._locationToY(u,q,Math.floor(2*n.size/c.barSpacing())+1);n.direction="up";break;case CanvasEx.MARKLOC_BELOWBAR:m=this._locationToY(u,q,Math.floor(2*n.size/c.barSpacing())+1);n.direction="down";break;default:console.warn("Bad location value: "+u),m=this._locationToY(CanvasEx.MARKLOC_ABSOLUTEUP,q),n.direction="up"}n.point=new MathEx.Point(t,
|
|
m);this._data.push(n);this._textCache.push({})}}}}}}};function BackgroundRenderer(a){this._data=a}BackgroundRenderer.prototype.draw=function(a){};BackgroundRenderer.prototype.drawBackground=function(a){var b=this._data;clearRect(a,b.x1,b.y1,b.x2-b.x1,b.y2-b.y1,generateColor(this._data.color,this._data.transparency))};BackgroundRenderer.prototype.hitTest=function(a){return null};TradingView.Study.StudyPaneView_backgrounds=function(a,b){this.Z0=a;this.D99=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 CompositeRenderer,b=0;b<this._data.length;b++)a.append(new BackgroundRenderer(this._data[b]));return a};
|
|
TradingView.Study.StudyPaneView_backgrounds.prototype._hideExtendedHours=function(a){return"inSession"===a||"outOfSession"===a?!this.Z0._series.properties().extendedHours.value():!1};
|
|
TradingView.Study.StudyPaneView_backgrounds.prototype._updateViewInternal=function(){this._data=[];var a=this.Z0.graphics().backgrounds;if(a){var b=this.D99.timeScale(),c=this.Z0.priceScale();if(c&&!c.isEmpty()&&b&&!b.isEmpty())for(var d=this.Z0.graphics().indexes,e=this.D99.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.Z0.properties().graphics.backgrounds[k];if(!this._hideExtendedHours(k)&&l.visible.value())for(var m,
|
|
q,k=0;k<h.length;k++){var n=h[k],t={},u=d[n.start],z=d[n.stop];if(!(z<f||u>e)&&null!=n.start&&null!=n.stop){var n=Math.ceil(b.indexToCoordinate(u,!0)-0.5*b.barSpacing()),s=Math.ceil(b.indexToCoordinate(z,!0)+0.5*b.barSpacing());q==u-1&&(n=m);m=s;q=z;0>n&&0>s||n>b.width()&&s>b.width()||(t.x1=n,t.x2=s,t.y1=0,t.y2=c.height(),t.color=l.color.value(),t.transparency=l.transparency.value(),this._data.push(t))}}}}};
|
|
TradingView.Study.StudyPaneView_polygons=function(a,b){this.Z0=a;this.D99=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 CompositeRenderer,b=0;b<this._data.length;b++)a.append(new PoligonRenderer(this._data[b],new HitTestResult(HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_polygons.prototype._updateViewInternal=function(){this._data=[];var a=this.Z0.graphics().polygons;if(a){var b=this.Z0.priceScale(),c=this.Z0.D99.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=this.Z0.firstValue(),e=this.Z0.graphics().indexes,f=this.D99.timeScale().visibleBars(),g=f.firstBar(),f=f.lastBar(),h=0;h<a.length;h++){var k=a[h];if(k.data){var l=this.Z0.properties().graphics.polygons[k.styleId];if(100!=l.transparency.value())for(var m=
|
|
0;m<k.data.length;m++){for(var q=k.data[m],n=Infinity,t=-Infinity,u=0;q.points&&u<q.points.length;u++)var z=e[q.points[u].index]+(q.points[u].offset||0),n=Math.min(n,z),t=Math.max(t,z);if(!(t<g||n>f)){n={};n.points=new List;for(u=0;q.points&&u<q.points.length;u++)objPoint=q.points[u],x=c.indexToCoordinate(e[objPoint.index]+(objPoint.offset||0)),t=objPoint.level,b.isPercent()&&(t=b.priceRange().convertToPercent(t,d)),y=b.priceToCoordinate(t),t=new MathEx.Point(x,y),t.data=u,n.points.append(t);n.color=
|
|
l.color.value();n.backcolor=l.color.value();n.linewidth=0;n.linestyle=CanvasEx.LINESTYLE_SOLID;n.filled=!0;n.fillBackground=!0;n.transparency=l.transparency.value();n.mouseTouchable=l.mouseTouchable.value();this._data.push(n)}}}}}};TradingView.Study.StudyPaneView_trendchannels=function(a,b){this.Z0=a;this.D99=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 CompositeRenderer,b=0;b<this._data.length;b++)a.append(new PoligonRenderer(this._data[b],new HitTestResult(HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_trendchannels.prototype._updateViewInternal=function(){this._data=[];var a=this.Z0.graphics().trendchannels;if(a){var b=this.Z0.priceScale(),c=this.Z0.D99.timeScale();if(b&&!b.isEmpty()&&c&&!c.isEmpty())for(var d=function(a){b.isPercent()&&(a=b.priceRange().convertToPercent(a,f));return b.priceToCoordinate(a)},e=function(a,b,c,d,e,f){var g=new MathEx.Point(0,0);c=new MathEx.Point(c,d);e&&(e=a.substract(b),(e=MathEx.intersectRayWithRect(a,a.add(e),g,c))&&
|
|
(a=e));f&&(e=b.substract(a),(e=MathEx.intersectRayWithRect(b,b.add(e),g,c))&&(b=e));return[a,b]},f=this.Z0.firstValue(),g=this.Z0.graphics().indexes,h=this.D99.timeScale().visibleBars(),k=h.firstBar(),h=h.lastBar(),l=0;l<a.length;l++){var m=a[l];if(m.data){var q=this.Z0.properties().graphics.trendchannels[m.styleId];if(100!=q.transparency.value())for(var n=0;n<m.data.length;n++){var t=m.data[n],u=g[t.startIndex],z=g[t.endIndex];if(!(Math.max(u,z)<k||Math.min(u,z)>h)){var s=d(t.startHighPrice,
|
|
b,f),A=d(t.startLowPrice,b,f),B=d(t.endHighPrice,b,f),w=B-(s-A),u=c.indexToCoordinate(u),z=c.indexToCoordinate(z),s=new MathEx.Point(u,s),A=new MathEx.Point(u,A),B=new MathEx.Point(z,B),w=new MathEx.Point(z,w),B=e(s,B,c.width(),b.height(),t.extendLeft,t.extendRight),t=e(A,w,c.width(),b.height(),t.extendLeft,t.extendRight),s=B[0],B=B[1],A=t[0],w=t[1],t={};t.points=new List;t.points.append(s);t.points.append(A);t.points.append(w);t.points.append(B);t.color=q.color.value();t.backcolor=q.color.value();
|
|
t.linewidth=0;t.linestyle=CanvasEx.LINESTYLE_SOLID;t.filled=!0;t.fillBackground=!0;t.transparency=q.transparency.value();t.mouseTouchable=!0;this._data.push(t)}}}}}};TradingView.Study.StudyPaneView_hhists=function(a,b){this.Z0=a;this.D99=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 CompositeRenderer,b;for(b in this._data)a.append(new HorizHistogramRenderer(this._data[b]));for(b=0;b<this._textData.length;b++)a.append(new TextRenderer(this._textData[b],this._textRendererCache,new HitTestResult(HitTestResult.REGULAR)));return a};
|
|
TradingView.Study.StudyPaneView_hhists.prototype._updateViewInternal=function(){this._data=[];this._textData=[];var a=this.Z0.priceScale(),b=this.D99.timeScale();if(a&&!a.isEmpty()&&b&&!b.isEmpty()){var c=this.Z0.graphics().hhists;if(c)for(var d=this.Z0.graphics().indexes,e=this.D99.timeScale().visibleBars(),f=e.firstBar(),e=e.lastBar(),g=0;g<c.length;g++){var h=c[g],k=this.Z0.properties().graphics.hhists[h.styleId];if(k.visible.value()){var h=h.dataObj,l;for(l in h){for(var m=
|
|
h[l],q=Infinity,n=-Infinity,t=m.length;t--;)q=Math.min(q,d[m[t].firstBarTime]),n=Math.max(n,d[m[t].lastBarTime]);n<f||q>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=this.Z0.firstValue(),k=null,l=null,m=null,q={},n=0;n<a.length;n++){var t=a[n];null===l&&(l=this._findActualRateLength(t.rate));null===k&&(k=Math.abs(d.indexToCoordinate(e[t.firstBarTime])-d.indexToCoordinate(e[t.lastBarTime])),k=b.percentWidth.value()*k/100,k-=l,k=Math.max(k,0));for(var u=!1,z,s=0;s<l;s++)if(0!=t.rate[s]){q[s]=void 0==q[s]?t.rate[s]:q[s]+t.rate[s];
|
|
if(c.isPercent())var A=c.priceRange().convertToPercent(t.priceHigh,h),B=c.priceRange().convertToPercent(t.priceLow,h);else A=t.priceHigh,B=t.priceLow;var w={};w.y1=c.priceToCoordinate(A)+1;w.y2=c.priceToCoordinate(B)-1;0===n&&(z=w.y2,lastHistHeight=w.y2-w.y1);B=b.location.value();A=b.direction.value();if(B==CanvasEx.HHISTLOC_ABSOLUTE&&A==CanvasEx.HHISTDIR_LEFTTORIGHT)var v=d.indexToCoordinate(e[t.firstBarTime]),C=1,G="left";else if(B==CanvasEx.HHISTLOC_ABSOLUTE&&A==CanvasEx.HHISTDIR_RIGHTTOLEFT)v=
|
|
d.indexToCoordinate(e[t.lastBarTime]),C=-1,G="right";else if(B==CanvasEx.HHISTLOC_RELATIVE&&A==CanvasEx.HHISTDIR_LEFTTORIGHT)v=0,C=1,G="left";else if(B==CanvasEx.HHISTLOC_RELATIVE&&A==CanvasEx.HHISTDIR_RIGHTTOLEFT)v=d.width(),C=-1,G="right";else throw Error("Unknown location/direction values: "+B+"/"+A);w.x1=0==s?v:v+C*(k*t.rate[s-1]/g+l);w.x2=w.x1+C*(k*t.rate[s]/g);w.colorBg=b.colors[s].value();w.transparency=b.transparencies[s].value();w.x0=v;f.push(w);m||(m=0.6*(w.y2-w.y1));if(!u&&b.showValues.value()&&
|
|
7.5<=m){var u=!0,I={},B=this.Z0.formatter(),E=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);};I.text="";for(var K=0;K<l;K++)I.text=E(I.text,B.format(t.rate[K]),A),K!=l-1&&(I.text=E(I.text,"x",A));I.color=b.valuesColor.value();I.font="arial";I.fontsize=m;I.horzAlign=G;I.vertAlign="middle";p1=new MathEx.Point(v+3*C,w.y2-0.61*(w.y2-w.y1));I.points=(new List).append(p1);I.offsetX=0;I.offsetY=
|
|
0;this._textData.push(I);if(n===a.length-1){w=v+3*C;K=z+0.39*lastHistHeight;w={text:"",color:TradingView.shiftColor(b.valuesColor.value(),1.5),font:"arial",fontsize:m,horzAlign:G,vertAlign:"middle",points:(new List).append(new MathEx.Point(w,K)),offsetX:0,offsetY:0};for(K=0;K<l;K++)w.text=E(w.text,B.format(q[K]),A),K!=l-1&&(w.text=E(w.text,"x",A));this._textData.push(w)}}}}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};function HorizHistogramRenderer(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}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 HitTestResult(HitTestResult.REGULAR):null};
|
|
HorizHistogramRenderer.prototype.draw=function(a){a.save();for(var b=0;b<this._data.length;b++){var c=this._data[b];a.fillStyle=generateColor(c.colorBg,c.transparency);a.fillRect(c.x1,c.y1,c.x2-c.x1,c.y2-c.y1);a.strokeStyle=generateColor(c.colorBg,0.8*c.transparency);a.beginPath();a.moveTo(c.x1,c.y1);a.lineTo(c.x2,c.y1);a.lineTo(c.x2,c.y2);a.lineTo(c.x1,c.y2);a.lineTo(c.x1,c.y1);a.stroke()}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 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 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)};
|
|
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"};Q20=function(a,b,c){this._options=c||{};this._w=a;this._opener=b;this._addMetric=1;this._addOpened=!1};Q20.prototype._interval=function(a){a=$(a.target);a.hasClass("disabled")||(this._w.setInterval(a.data("interval")),this.close())};Q20.prototype._quickTitle=function(a){return a?$.t("Remove from favorites"):$.t("Add to favorites")};
|
|
Q20.prototype._onQuick=function(a){var b=$(a.target.parentNode),b=this._w.toggleQuick(b.data("interval"));$(a.target.parentNode).toggleClass("quicked",b);$(a.target).attr("title",this._quickTitle(b));return!1};Q20.prototype._onDelete=function(a){a=$(a.target.parentNode);this._w.removeInterval(a.data("interval"));this._reopen();return!1};Q20.prototype._showControlButtons=function(){return!0};
|
|
Q20.prototype._append=function(a,b){var c=$("<span>").addClass("item").toggleClass("active",b==this._w.getInterval()).toggleClass("quicked",this._w.inQuick(b)).toggleClass("disabled",!this._w.isAvailable(b)).text(this._w.fullLabel(b)).data("interval",b);this._showControlButtons()&&(this._w.isDefaultInterval(b)||c.prepend($("<span>").addClass("delete").attr("title","Remove custom interval").click(this._onDelete.bind(this))),this._w._options.notShowQuicks||c.prepend($("<span>").addClass("to-quick").attr("title",
|
|
this._quickTitle(this._w.inQuick(b))).click(this._onQuick.bind(this))));c.click(this._interval.bind(this));a.append(c)};
|
|
Q20.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("add").appendTo(d),
|
|
g={1:"minutes",60:"hours",D:"days",W:"weeks",M:"months"};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(){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)};Q20.prototype._addInterval=function(a){};
|
|
Q20.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):this._w.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||
|
|
D76.enabled("charting_library")||this._appendAdd(a)};Q20.prototype._reopen=function(){this._open(this._menu,this._w._sorted(this._w._intervals))};
|
|
Q20.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)};Q20.prototype._setMaxHeight=function(a,b){a.height()>=b&&(a.css("max-height",b+"px"),a.width(a.width()+18))};Q20.prototype.close=function(a){if(a&&$(a.target).parents("span.item-add, .charts-popup-list.metrics").length)return!1;this._menu.remove();$(document.body).off(".interval-menu");delete this._menu;this._opener.removeClass("active");return!0};Q21=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);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 Q20(this,this._mainSub,this._options);this.onResize=new Delegate;Q45.intraday.subscribe(this._fullUpdate.bind(this));Q45.interval.subscribe(this.activateInterval.bind(this));if(!$.browser.msie)TVXWindowEvents.on("intervalwidget-change",
|
|
this._onChangeInAnotherTab.bind(this))};Q21.prototype.forceUpdate=function(){this._fullUpdate(!0)};Q21.prototype._fullUpdate=function(a){this._setupIntervals(a);this._setupQuicks(a);this.reactivateInterval();this._resize()};Q21.prototype._onChangeInAnotherTab=function(){this._fullUpdate(!0)};Q21.DWMPattern=/^(\d*)([DWM])$/;Q21.prototype.DWMPattern=Q21.DWMPattern;
|
|
Q21.isDWM=function(a){return(a=this.DWMPattern.exec(a+""))?{qty:a[1]||"1",unit:a[2]}:!1};Q21.prototype.isDWM=Q21.isDWM;Q21.prototype.isDefaultInterval=function(a){return a in Z15.defaultResolutions()};Q21.prototype._setupIntervals=function(){this._intervals=$.extend({},Z15.defaultResolutions())};
|
|
Q21.prototype._sorted=function(a){if(!Array.isArray(a)){var b=[];$.each(a,function(a){b.push(a)});a=b}return a.sort(function(a,b){function e(a){var b=Q21.isDWM(a);return b?{D:1440,W:10080,M:43200}[b.unit]*b.qty:parseInt(a)}return e(a)-e(b)})};
|
|
Q21.prototype._setupQuicks=function(a){if(!this._options.notShowQuicks){var b={};TradingView.onWidget()&&(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)};Q21.prototype._removeCustomIntervalQuicks=function(a){var b={};$.each(a,function(a,d){this.isDefaultInterval(a)&&(b[a]=d)}.bind(this));return b};
|
|
Q21.prototype.element=function(){return this._e};Q21.prototype.mainButton=function(){return this._main};Q21.prototype._quicks=function(){return this._quick.find("span").slice(0,-1)};
|
|
Q21.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})}};Q21.prototype.isHour=function(a){return 60<=a&&!(a%60)};
|
|
Q21.prototype.readable=function(a,b,c){var d="m",e=this.isDWM(a);e&&(a=e.qty,d=e.unit);a=parseInt(a);if(!a)throw new TypeError("Wrong interval value: "+a);"m"===d&&this.isHour(a)&&(a=~~(a/60),d="h");b=b?a:null;return""+(c&&1===a&&"m"!=d?"":a)+this.postfix(d,b)};Q21.prototype.shortLabel=function(a){return translatedIntervalString(this.readable(a,!1))};Q21.prototype.fullLabel=function(a){return this.readable(a,!0)};
|
|
Q21.prototype._addQuicked=function(a){this._quicks().remove();a=this._sorted(a);$.each(a,function(a,c){var d=$("<span>").data("interval",c).text(this.shortLabel(c)).toggleClass("selected",c==this.getInterval()).toggleClass("disabled",!this.isAvailable(c));this._main.before(d)}.bind(this));this._resize()};Q21.prototype._resize=function(){this.onResize.fire()};
|
|
Q21.prototype.addQuick=function(a){this._quicked[a]=!0;this._addQuicked(this._quicked);this.saveSettings();this.reactivateInterval()};Q21.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};Q21.prototype.inQuick=function(a){return null!=this._quickWithInterval(a)};
|
|
Q21.prototype.removeQuick=function(a){this._quickWithInterval(a)&&(this._quickWithInterval(a).remove(),this._resize(),delete this._quicked[a],this.saveSettings(),this.reactivateInterval())};Q21.prototype.toggleQuick=function(a){var b=this.inQuick(a);b?this.removeQuick(a):this.addQuick(a);return!b};Q21.prototype.hasQuicks=function(){return!!this._quicks().length};Q21.prototype.deactivate=function(a){this._quick.find("span").removeClass("selected")};
|
|
Q21.prototype.activateInterval=function(a){a.value&&(a=a.value());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))};Q21.prototype.reactivateInterval=function(){this.activateInterval(this.getInterval())};Q21.prototype.getInterval=function(){return Q45.interval.value()};
|
|
Q21.prototype.setInterval=function(a){Q45.interval.setValue(""+a)};Q21.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()};Q21.prototype._selectMenu=function(a){this._mainSub.hasClass("active")?this._menu.close(a):this._menu.open(this._sorted(this._intervals))};
|
|
Q21.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 ChangeIntervalDialog({callback:function(a){Q45.interval.setValue(a)}})).show(),b=$(this);b.addClass("active");a.on("destroy",function(){b.removeClass("active")})})};
|
|
Q21.prototype.addInterval=function(a){};Q21.prototype.removeInterval=function(a){};Q21.prototype.saveIntervals=function(){};Q21.prototype.saveQuicked=function(){TVSettings.setJSON("IntervalWidget.quicks",this._quicked)};Q21.prototype.saveSettings=function(){this.saveQuicked();this.saveIntervals();TVXWindowEvents.emit("intervalwidget-change")};
|
|
Q21.isMinute=function(a){a=parseInt(a);return 1<=a&&1440>=a};Q21.prototype.isMinute=Q21.isMinute;Q21.prototype.isAvailable=function(a){var b=Q45.supportedResolutions.value(),c=!1,c="undefined"!=typeof b?-1!=b.indexOf(a):!0;return Q45.intraday.value()?c:this.isDWM(a)&&c};Q22=function(a){this._fullInvalidation=a?a:Q22.UPDATE_CURSOR_ONLY;this._invalidatedPanes={}};Q22.UPDATE_CURSOR_ONLY=1;Q22.LIGHT_UPDATE=2;Q22.FULL_UPDATE=3;Q22.prototype.invalidatePane=function(a,b){this._invalidatedPanes[a]=this._invalidatedPanes[a]?Math.max(this._invalidatedPanes[a],b):b};
|
|
Q22.prototype.invalidateAll=function(a){this._fullInvalidation=Math.max(this._fullInvalidation,a)};Q22.prototype.fullInvalidation=function(){return this._fullInvalidation};Q22.prototype.invalidateForPane=function(a){return this._invalidatedPanes[a]?Math.max(this._invalidatedPanes[a],this._fullInvalidation):this._fullInvalidation};
|
|
Q22.prototype.merge=function(a){this.force=this.force||a.force;this._fullInvalidation=Math.max(this._fullInvalidation,a._fullInvalidation);for(var b in a._invalidatedPanes)this._invalidatedPanes[b]=this._invalidatedPanes[b]?Math.max(this._invalidatedPanes[b],a._invalidatedPanes[b]):a._invalidatedPanes[b]};
|
|
Q22.prototype.exclude=function(a){this._fullInvalidation<=a&&(this._fullInvalidation=0);for(var b in this._invalidatedPanes)this._invalidatedPanes[b]<=a&&(this._invalidatedPanes[b]=0)};var PropertyPagesFactory=function(){function a(a){return a instanceof D46?a instanceof TradingView.LineToolRiskReward?W25:a instanceof TradingView.LineToolRegressionTrend?W24:a instanceof TradingView.LineToolEllipse||a instanceof TradingView.LineToolRotatedRectangle||a instanceof TradingView.LineToolArc?null:a instanceof TradingView.LineToolTrendAngle?W28: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?W11:a instanceof TradingView.LineToolBarsPattern||a instanceof TradingView.LineToolDisjointAngle||a instanceof TradingView.LineToolFlatBottom?null:a instanceof TradingView.LineToolVertLine?W35:a instanceof Q63?
|
|
W43:a instanceof TradingView.LineToolIcon?null:W14:a instanceof TradingView.Study?a instanceof TradingView.study_ElliottWave?W40:a instanceof TradingView.study_Compare?W38:W41:null}function b(a,b){if(a instanceof TradingView.Series||a instanceof Q7||a instanceof TradingView.ESDStudyBase)return Q85;if(a instanceof TradingView.Study)return a instanceof
|
|
TradingView.study_PivotPointsHighLow?W45:a instanceof TradingView.study_PivotPointsStandard?W46:a instanceof TradingView.study_ZigZag?W48:a instanceof TradingView.study_Overlay?W44:a instanceof TradingView.study_LinearRegression?W42:"Volume@tv-basicstudies"==a.metaInfo().id?W50:W47;if(a instanceof D46){if(a instanceof
|
|
TradingView.LineToolRegressionTrend)return W42;if(a instanceof TradingView.LineToolTrendLine)return W32;if(a instanceof TradingView.LineToolTrendAngle)return W29;if(a instanceof TradingView.LineToolDateRange||a instanceof TradingView.LineToolPriceRange)return Q95;if(a instanceof TradingView.LineToolHorzLine||a instanceof TradingView.LineToolHorzRay)return W12;
|
|
if(a instanceof TradingView.LineToolVertLine)return W36;if(a instanceof TradingView.LineToolPitchfork)return W18;if(a instanceof TradingView.LineToolPitchfan)return W17;if(a instanceof TradingView.LineToolText)return W27;if(a instanceof TradingView.LineToolNote)return LineToolNotePropertyPage;if(a instanceof TradingView.LineToolCallout)return Q93;if(a instanceof
|
|
TradingView.LineToolRectangle||a instanceof TradingView.LineToolRotatedRectangle)return W23;if(a instanceof TradingView.LineToolEllipse)return Q98;if(a instanceof TradingView.LineToolArc)return Q87;if(a instanceof TradingView.LineToolTriangle)return W34;if(a instanceof TradingView.LineToolParallelChannel)return W16;if(a instanceof TradingView.LineToolDisjointAngle)return Q96;
|
|
if(a instanceof TradingView.LineToolFlatBottom)return W7;if(a instanceof TradingView.LineToolArrowMark)return Q88;if(a instanceof TradingView.LineToolPriceLabel)return W21;if(a instanceof TradingView.LineToolIcon)return W13;if(a instanceof TradingView.LineToolBalloon)return Q89;if(a instanceof TradingView.LineToolBrush)return Q92;
|
|
if(a instanceof TradingView.LineToolPrediction)return W20;if(a instanceof TradingView.LineToolPolyline)return W19;if(a instanceof TradingView.LineToolGannSquare)return W10;if(a instanceof TradingView.LineToolGannComplex)return W8;if(a instanceof TradingView.LineToolGannFan)return W9;if(a instanceof TradingView.LineToolFibRetracement)return W1;
|
|
if(a instanceof TradingView.LineToolFibChannel)return Q99;if(a instanceof TradingView.LineToolFibCircles)return Q84;if(a instanceof TradingView.LineToolFibSpiral)return W4;if(a instanceof TradingView.LineToolFibSpeedResistanceArcs)return W2;if(a instanceof TradingView.LineToolTrendBasedFibExtension)return W30;
|
|
if(a instanceof TradingView.LineToolTrendBasedFibTime)return W31;if(a instanceof TradingView.LineToolFibSpeedResistanceFan)return W3;if(a instanceof TradingView.LineToolFibTimeZone)return W5;if(a instanceof TradingView.LineToolProjection)return W22;if(a instanceof TradingView.LineToolFibWedge)return W6;if(a instanceof
|
|
TradingView.LineToolCircleLines)return Q94;if(a instanceof TradingView.LineToolElliott)return Q97;if(a instanceof TradingView.LineToolBarsPattern)return Q91;if(a instanceof TradingView.LineToolRiskReward)return W26;if(a instanceof TradingView.LineTool5PointsPattern)return W15;if(a instanceof TradingView.LineToolABCD)return Q86;
|
|
if(a instanceof TradingView.LineToolTrianglePattern)return W33;if(a instanceof TradingView.LineToolThreeDrivers)return Q86;if(a instanceof TradingView.LineToolHeadAndShoulders)return W15;if(a instanceof Q63)return W47}return null}function c(a){return a instanceof TradingView.ESDStudyBase?null:a instanceof TradingView.Study?W39:
|
|
null}return{createInputsPropertyPage:function(b,c){var f=a(b);return f?new f(b.properties(),c,b):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 PropertyGroup(a,b,c,d){this._property=a;this._name=b;this._children=c;this._propertyPage=d}PropertyGroup.prototype.property=function(){return this._property};PropertyGroup.prototype.name=function(){return this._name};PropertyGroup.prototype.children=function(){return this._children};PropertyGroup.prototype.propertyPage=function(){return this._propertyPage};function Z6(a,b){this.D99=b;this._bindings=new List;this._property=a}Z6.prototype.model=function(){return this.D99};Z6.prototype.bindControl=function(a){this._bindings.append(a)};Z6.prototype.loadData=function(){for(var a=0;a<this._bindings.size();a++){var b=this._bindings.item(a);b.setValue(b.property().value())}};
|
|
Z6.prototype.saveData=function(){this.D99.beginUndoMacro();for(var a=0;a<this._bindings.size();a++){var b=this._bindings.item(a);this.D99.setProperty(b.property(),b.value())}this.D99.endUndoMacro()};Z6.prototype.createColorPicker=function(){return $(document.createElement("input")).addClass("colorpicker-widget").bind("customcolorchange",function(a,b){TVSettings.setJSON("pickerCustomColors",b)}).tvcolorpicker({customColors:TVSettings.getJSON("pickerCustomColors",[])})};
|
|
Z6.prototype.createTextEditor=function(a,b){var c={};a&&(c.width=a);b&&(c.height=b);return $(document.createElement("textarea")).css(c)};Z6.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)};
|
|
Z6.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};Z6.prototype.createFontEditor=function(a){a=a||factoryDefaults("chartproperties.editorFontsList");return this.createCombo(a)};Z6.prototype.createFontSizeEditor=function(a){return this.createCombo(a||[10,11,12,14,16,20,24,28,32,40]).addClass("tv-select-container-fontsize")};
|
|
Z6.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>")};Z6.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>")};
|
|
Z6.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};Z6.prototype.createTableInTable=function(a){a=$("<tr>").appendTo(a);a=$("<td>").appendTo(a);return $('<table cellpadding="0" cellspacing="0">').appendTo(a)};
|
|
Z6.prototype._labelToId=function(a){return"control"+a.replace(/(^| )\w/g,function(a){return"-"+a.trim().toLowerCase()})+Math.floor(1E3*Math.random())};Z6.prototype.addRow=function(a){return $(document.createElement("tr")).appendTo(a)};
|
|
Z6.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)};Z6.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};
|
|
Z6.prototype.addColorPickerRow=function(a,b){return this.addEditorRow(a,b,this.createColorPicker())};Z6.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)};Z6.prototype.addFontEditorRow=function(a,b){return this.addEditorRow(a,b,this.createFontEditor())};
|
|
Z6.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))}};Z6.prototype.parseRule=function(a,b,c){if(!a)return!0;a=a.split("==");return 2>a.length?!1:c[a[0]].value()==a[1]};Z6.prototype.destroy=function(){for(var a=this._bindings.size();a--;)this._bindings.item(a).destroy();this._bindings.clear()};
|
|
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.setValue(b.value()),b.listeners().subscribe(this,Binding.prototype.propertyChanged))):TradingView.logDebug("Binding: missing control")}
|
|
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){13==a.which&&(a=c.value(),c.setValueToProperty(a),c.setValue(a))}),a.focusout(function(a){a=c.value();c.setValueToProperty(a);c.setValue(a)}),a.change(function(a){a=c.value();c.setValueToProperty(a);c.setValue(a)})};Binding.prototype.control=function(){return this._control};
|
|
Binding.prototype.setValueToProperty=function(a){this._undoModel.setProperty(this._property,a,this._undoText)};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)};function UppercaseTransformer(a){return a.toUpperCase()}function GreateTransformer(a){return function(b){return b<a?a:b}}
|
|
function LessTransformer(a){return function(b){return b>a?a:b}}function ToIntTransformer(a){return function(b){b=parseInt(b,10);return isNaN(b)?a:b}}function ToFloatTransformer(a){return function(b){b=parseFloat(b);return isNaN(b)?a:b}}function ToAsciiTransformer(){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}}function ReplaceEmptyTransformer(a){return function(b){return 0===b.length?a:b}}
|
|
function SimpleStringBinder(a,b,c,d,e,f){Binding.call(this,a,b,d,e,f);this._transformFunction=c;this._attachToControl(a,d)}inherit(SimpleStringBinder,Binding);SimpleStringBinder.prototype.value=function(){var a=this._control.val();if(this._transformFunction)if(isArray(this._transformFunction))for(var b=0;b<this._transformFunction.length;b++)a=this._transformFunction[b](a);else a=this._transformFunction(a);return a};SimpleStringBinder.prototype.setValue=function(a){this._control.val()!==a&&this._control.val(a)};
|
|
function Z7(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(Z7,Binding);Z7.prototype._forEachSubControl=function(a){this._subControlIds.forEach(function(b){b="#"+b;b=this.control().find(b);a.call(this,b)},this)};
|
|
Z7.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]};
|
|
Z7.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=[ToIntTransformer(0),GreateTransformer(0),LessTransformer(23)],d=[ToIntTransformer(0),GreateTransformer(0),LessTransformer(59)];return b(a[0],c)+b(a[1],d)+"-"+b(a[2],c)+b(a[3],d)};
|
|
Z7.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)})};
|
|
function Z8(a,b,c,d,e,f,g){this.D99=d;this._mainSeries=f;this._toIntTransformer=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(Z8,Binding);
|
|
Z8.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)[TIME_PLOT]};
|
|
Z8.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,SEARCH_FROM_RIGHT),null===a?this._disabled=!0:(a=this._mainSeries.bars().lastIndex()-a,this._control.val()!==a.toString()&&this._control.val(a)))};
|
|
function Z9(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(Z9,Binding);Z9.prototype.value=function(){return this._control.val()};Z9.prototype.setValue=function(a){var b=this.value();a&&b!==a&&this._control.val(a)};
|
|
function Z10(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(Z10,Binding);Z10.prototype.value=function(){var a=this._control.val();this._transformFunction&&(a=this._transformFunction(a));return a};
|
|
Z10.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){}};function StaticContentBinder(a,b){Binding.call(this,a,b)}inherit(StaticContentBinder,Binding);StaticContentBinder.prototype.value=function(){return this._property.value()};StaticContentBinder.prototype.setValue=function(a){return this._control.html(a)};
|
|
function Z11(a,b,c,d,e,f){if(!a.is(":checkbox, :radio"))return new Z11.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(Z11,Binding);Z11.prototype.value=function(){return this.control().is(":checked")};
|
|
Z11.prototype.setValue=function(a){if(this.control().is(".visibility-switch")){var b={opacity:a?1:0.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)};function DisabledBinder(a,b,c,d,e){Binding.call(this,a,b,c,d,e)}inherit(DisabledBinder,Binding);DisabledBinder.prototype.value=function(){return this.control().is(":disabled")};DisabledBinder.prototype.setValue=function(a){return this.control().attr("disabled",!!a)};
|
|
Z11.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(Z11.PushButtonBinder,Binding);Z11.PushButtonBinder.prototype.value=function(){return this.control().hasClass("active")};Z11.PushButtonBinder.prototype.setValue=function(a){return this.control().toggleClass("active",!!a)};
|
|
function Z13(a,b,c,d,e){c?(Binding.call(this,a,b,!0,c,d),e?a.callbacks().subscribe(this,e):a.callbacks().subscribe(this,Z13.prototype.onActionCallback)):TradingView.logDebug("Z13: Missed undo model")}inherit(Z13,Binding);Z13.prototype.onActionCallback=function(a){this._undoModel.setProperty(this._property,this.value(),this._undoText)};Z13.prototype.value=function(){return this.control().checked};
|
|
Z13.prototype.setValue=function(a){return this.control().checked=!!a};function ColorBinding(a,b,c,d){Binding.call(this,a,b,c,d);var e=this;c&&a.change(function(){e.setValueToProperty(e.value())})}inherit(ColorBinding,Binding);ColorBinding.prototype.value=function(){return this._control.val()};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)})};
|
|
function SliderBinder(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(SliderBinder,Binding);
|
|
SliderBinder.prototype.value=function(){return this._control.slider("option","value")};SliderBinder.prototype.setValue=function(a){this._control.slider("option","value",a)};function Z14(a,b,c,d,e,f){Z11.call(this,a,b,d,e,f);this._intervalProperty=c;this._intervalProperty.listeners().subscribe(this,this.onIntervalChanged);this.onIntervalChanged()}inherit(Z14,Z11);
|
|
Z14.prototype.onIntervalChanged=function(){1440>+this._intervalProperty.value()?this._control.attr({disabled:!1,checked:!!this._property.value()}):this._control.attr({disabled:!0,checked:!1})};Z14.prototype.value=function(){return this._control.is(":disabled")?this._property.value():Z11.prototype.value.call(this)};Z14.prototype.setValue=function(a){if(!this._control.is(":disabled"))return Z11.prototype.setValue.call(this,a)};
|
|
Z14.prototype.destroy=function(){this._intervalProperty.listeners().unsubscribe(this,this.onIntervalChanged);delete this._intervalProperty;Z11.prototype.destroy.call(this,arguments)};function SeriesStylePropertyPageMixin(){}inherit(SeriesStylePropertyPageMixin,Z6);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()})};
|
|
SeriesStylePropertyPageMixin.prototype.prepareLayoutImpl=function(a,b,c,d){d=d||{};for(var e={},f=this,g=0;g<a.inputs.length;g++){var h=a.inputs[g],k=h.id,l=this.getInputTitle(k,c),m=$("<tr/>");m.appendTo(b);var q=$("<td/>");q.appendTo(m);q.addClass("propertypage-name-label");q.text(l);var n=$("<td"+(d.valueColspan?' colspan = "'+d.valueColspan+'"':"")+"/>");n.appendTo(m);q=null;if(h.options)for(var q=$("<select/>"),t=0;t<h.options.length;t++){var u=h.options[t];$("<option value='"+u+"'>"+u+"</option>").appendTo(q)}else q=
|
|
$("<input/>"),"bool"===h.type?q.attr("type","checkbox"):q.attr("type","text");q.appendTo(n);q.css("width","100px");l="Change "+l;if(h.options)this.bindControl(new Z10(q,c.inputs[k],null,!0,this.model(),l));else if("integer"===h.type)transformers=[ToIntTransformer(h.defval)],h.min&&transformers.push(GreateTransformer(h.min)),h.max&&transformers.push(LessTransformer(h.max)),this.bindControl(new SimpleStringBinder(q,c.inputs[k],transformers,!1,this.model(),l)),q.addClass("ticker");else if("float"===
|
|
h.type){transformers=[ToFloatTransformer(h.defval)];if(h.min){n=void 0;if(("BarSetRenko@tv-prostudies"==a.id||"BarSetPnF@tv-prostudies"==a.id)&&"boxSize"==h.id||"BarSetKagi@tv-prostudies"==a.id&&"reversalAmount"==h.id)n=this.D99.model().mainSeries().symbolInfo(),n=n.minmov/n.pricescale;transformers.push(GreateTransformer(n?n:h.min))}h.max&&transformers.push(LessTransformer(h.max));this.bindControl(new SimpleStringBinder(q,c.inputs[k],transformers,!1,this.model(),l));q.addClass("ticker")}else"text"===
|
|
h.type&&this.bindControl(new SimpleStringBinder(q,this._property.inputs[k],null,!1,this.model(),l));q.change(function(b){f.refreshStateControls(e,a.inputs,c.inputs)});e[h.id]=m}this.refreshStateControls(e,a.inputs,c.inputs)};SeriesStylePropertyPageMixin.prototype.getMetaInfo=function(a){for(var b=this.D99.m_model._studiesMetaData,c=0;c<b.size();c++)if(b.item(c).id===a)return b.item(c);return null};
|
|
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),q=this._barsTbody=$("<tbody>").appendTo(c),n=this._lineTbody=$("<tbody>").appendTo(c);b=this._areaTbody=
|
|
$("<tbody>").appendTo(c);var t=this._renkoTbody=$("<tbody>").appendTo(c),u=this._pbTbody=$("<tbody>").appendTo(c);a=this._kagiTbody=$("<tbody>").appendTo(c);c=this._pnfTbody=$("<tbody>").appendTo(c);var e=this.addLabeledRow(e,"Style"),z=$(document.createElement("td")).appendTo(e);z.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 W44||$("<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(z);
|
|
this.switchStyle();this.bindControl(new Z10(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 z=this.createColorPicker(),s=this.createColorPicker(),A=this.createColorPicker(),B=this.createColorPicker(),w=this.createColorPicker(),v=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(B).add(w)),C=$("<input type='checkbox' class='visibility-switch'/>").data("hides",
|
|
$(A)),G=$("<input type='checkbox'/>"),f=this.addLabeledRow(f,"Color bars based on previous close",G);$("<td>").append(G).prependTo(f);f=this.addLabeledRow(k,"Candles");$("<td>").prependTo(f);$("<td>").append(z).appendTo(f);$("<td>").append(s).appendTo(f);f=this.addLabeledRow(k,"Borders",v);$("<td>").append(v).prependTo(f);$("<td>").append(B).appendTo(f);$("<td>").append(w).appendTo(f);f=this.addLabeledRow(k,"Wick",C);$("<td>").append(C).prependTo(f);$("<td>").append(A).appendTo(f);this.bindControl(new ColorBinding(z,
|
|
d.candleStyle.upColor,!0,this.model(),"Change Candle Up Color"));this.bindControl(new ColorBinding(s,d.candleStyle.downColor,!0,this.model(),"Change Candle Down Color"));this.bindControl(new Z11(C,d.candleStyle.drawWick,!0,this.model(),"Change Candle Wick Visibility"));this.bindControl(new ColorBinding(A,d.candleStyle.wickColor,!0,this.model(),"Change Candle Wick Color"));this.bindControl(new Z11(v,d.candleStyle.drawBorder,!0,this.model(),"Change Candle Border Visibility"));this.bindControl(new ColorBinding(B,
|
|
d.candleStyle.borderUpColor,!0,this.model(),"Change Candle Up Border Color"));this.bindControl(new ColorBinding(w,d.candleStyle.borderDownColor,!0,this.model(),"Change Candle Down Border Color"));this.bindControl(new Z11(G,d.candleStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close"));k=this.createColorPicker();z=this.createColorPicker();s=this.createColorPicker();A=this.createColorPicker();B=this.createColorPicker();w=$("<input type='checkbox' class='visibility-switch'/>").data("hides",
|
|
$(A).add(B));v=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(s));f=this.addLabeledRow(l,"Candles");$("<td>").prependTo(f);$("<td>").append(k).appendTo(f);$("<td>").append(z).appendTo(f);f=this.addLabeledRow(l,"Borders",w);$("<td>").append(w).prependTo(f);$("<td>").append(A).appendTo(f);$("<td>").append(B).appendTo(f);f=this.addLabeledRow(l,"Wick",v);$("<td>").append(v).prependTo(f);$("<td>").append(s).appendTo(f);this.bindControl(new ColorBinding(k,d.hollowCandleStyle.upColor,
|
|
!0,this.model(),"Change Hollow Candle Up Color"));this.bindControl(new ColorBinding(z,d.hollowCandleStyle.downColor,!0,this.model(),"Change Hollow Candle Down Color"));this.bindControl(new Z11(v,d.hollowCandleStyle.drawWick,!0,this.model(),"Change Hollow Candle Wick Visibility"));this.bindControl(new ColorBinding(s,d.hollowCandleStyle.wickColor,!0,this.model(),"Change Hollow Candle Wick Color"));this.bindControl(new Z11(w,d.hollowCandleStyle.drawBorder,!0,this.model(),"Change Hollow Candle Border Visibility"));
|
|
this.bindControl(new ColorBinding(A,d.hollowCandleStyle.borderUpColor,!0,this.model(),"Change Hollow Candle Up Border Color"));this.bindControl(new ColorBinding(B,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(q,
|
|
"Up Color");g=this.addColorPickerRow(q,"Down Color");this.bindControl(new ColorBinding(f,d.barStyle.upColor,!0,this.model(),"Change Bar Up Color"));this.bindControl(new ColorBinding(g,d.barStyle.downColor,!0,this.model(),"Change Bar Down Color"));this.bindControl(new Z11(l,d.barStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close"));this.bindControl(new Z11(k,d.barStyle.dontDrawOpen,!0,this.model(),"Change HLC Bars"));g=TradingView.createPriceSourceEditor();
|
|
f=this.addLabeledRow(n,"Price Source");$('<td colspan="3">').append(g).appendTo(f);f=this.addLabeledRow(n,"Type");f=$('<td colspan="3">').appendTo(f);f.addClass("property-wide-select");q=$(document.createElement("select"));$("<option value="+TradingView.Series.STYLE_LINE_TYPE_SIMPLE+">"+$.t("Simple")+"</option>").appendTo(q);$("<option value="+TradingView.Series.STYLE_LINE_TYPE_MARKERS+">"+$.t("With Markers")+"</option>").appendTo(q);$("<option value="+TradingView.Series.STYLE_LINE_TYPE_STEP+">"+
|
|
$.t("Step")+"</option>").appendTo(q);q.appendTo(f);f=this.addLabeledRow(n,"Line");n=this.createColorPicker();l=TradingView.createLineWidthEditor();$("<td>").append(n).appendTo(f);$("<td>").append(l).appendTo(f);this.bindControl(new Z10(g,d.lineStyle.priceSource,null,!0,this.model(),"Change Price Source"));this.bindControl(new Z10(q,d.lineStyle.styleType,parseInt,!0,this.model(),"Change Line Type"));this.bindControl(new ColorBinding(n,d.lineStyle.color,!0,this.model(),"Change Line Color"));
|
|
this.bindControl(new SliderBinder(l,d.lineStyle.linewidth,!0,this.model(),"Change Line Width"));d.haStyle&&(n=this.createColorPicker(),g=this.createColorPicker(),q=this.createColorPicker(),l=this.createColorPicker(),k=this.createColorPicker(),z=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(l).add(k)),s=$("<input type='checkbox' class='visibility-switch'/>").data("hides",$(q)),A=$("<input type='checkbox'/>"),f=this.addLabeledRow(h,"Color bars based on previous close",A),$("<td>").append(A).prependTo(f),
|
|
f=this.addLabeledRow(m,"Candles"),$("<td>").prependTo(f),$("<td>").append(n).appendTo(f),$("<td>").append(g).appendTo(f),f=this.addLabeledRow(m,"Borders",z),$("<td>").append(z).prependTo(f),$("<td>").append(l).appendTo(f),$("<td>").append(k).appendTo(f),f=this.addLabeledRow(m,"Wick",s),$("<td>").append(s).prependTo(f),$("<td>").append(q).appendTo(f),this.bindControl(new ColorBinding(n,d.haStyle.upColor,!0,this.model(),"Change Heiken Ashi Up Color")),this.bindControl(new ColorBinding(g,d.haStyle.downColor,
|
|
!0,this.model(),"Change Heiken Ashi Down Color")),this.bindControl(new Z11(s,d.haStyle.drawWick,!0,this.model(),"Change Heiken Ashi Wick Visibility")),this.bindControl(new ColorBinding(q,d.haStyle.wickColor,!0,this.model(),"Change Heiken Ashi Wick Color")),this.bindControl(new Z11(z,d.haStyle.drawBorder,!0,this.model(),"Change Heiken Ashi Border Visibility")),this.bindControl(new ColorBinding(l,d.haStyle.borderUpColor,!0,this.model(),"Change Heiken Ashi Up Border Color")),this.bindControl(new ColorBinding(k,
|
|
d.haStyle.borderDownColor,!0,this.model(),"Change Heiken Ashi Down Border Color")),this.bindControl(new Z11(A,d.haStyle.barColorsOnPrevClose,!0,this.model(),"Change Color Bars Based On Previous Close")));this instanceof W44||D76.enabled("charting_library")||($("<option value="+TradingView.Series.STYLE_RENKO+">Renko</option>").appendTo(e),$("<option value="+TradingView.Series.STYLE_PB+">Line break</option>").appendTo(e),$("<option value="+TradingView.Series.STYLE_KAGI+
|
|
">Kagi</option>").appendTo(e),$("<option value="+TradingView.Series.STYLE_PNF+">Point & Figure</option>").appendTo(e),h=this.createColorPicker(),m=this.createColorPicker(),f=this.addLabeledRow(t,"Up bars"),$('<td class="some-colorpicker">').append(h).append(m).appendTo(f),e=this.createColorPicker(),n=this.createColorPicker(),f=this.addLabeledRow(t,"Down bars"),$('<td class="some-colorpicker">').append(e).append(n).appendTo(f),g=this.createColorPicker(),q=this.createColorPicker(),f=this.addLabeledRow(t,
|
|
"Projection up bars"),$('<td class="some-colorpicker">').append(g).append(q).appendTo(f),l=this.createColorPicker(),k=this.createColorPicker(),f=this.addLabeledRow(t,"Projection down bars"),$('<td class="some-colorpicker">').append(l).append(k).appendTo(f),this.prepareLayoutImpl(this.getMetaInfo("BarSetRenko@tv-prostudies"),t,d.renkoStyle),this.bindControl(new ColorBinding(h,d.renkoStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new ColorBinding(e,d.renkoStyle.downColor,!0,
|
|
this.model(),"Change Bar Down Color")),this.bindControl(new ColorBinding(g,d.renkoStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new ColorBinding(l,d.renkoStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),this.bindControl(new ColorBinding(m,d.renkoStyle.borderUpColor,!0,this.model(),"Change Border Bar Up Color")),this.bindControl(new ColorBinding(n,d.renkoStyle.borderDownColor,!0,this.model(),"Change Border Bar Down Color")),
|
|
this.bindControl(new ColorBinding(q,d.renkoStyle.borderUpColorProjection,!0,this.model(),"Change Projection Border Bar Up Color")),this.bindControl(new ColorBinding(k,d.renkoStyle.borderDownColorProjection,!0,this.model(),"Change Projection Border Bar Down Color")),t=this.createColorPicker(),h=this.createColorPicker(),f=this.addLabeledRow(u,"Up bars"),$('<td class="some-colorpicker">').append(t).append(h).appendTo(f),m=this.createColorPicker(),e=this.createColorPicker(),f=this.addLabeledRow(u,"Down bars"),
|
|
$('<td class="some-colorpicker">').append(m).append(e).appendTo(f),n=this.createColorPicker(),g=this.createColorPicker(),f=this.addLabeledRow(u,"Projection up bars"),$('<td class="some-colorpicker">').append(n).append(g).appendTo(f),q=this.createColorPicker(),l=this.createColorPicker(),f=this.addLabeledRow(u,"Projection down bars"),$('<td class="some-colorpicker">').append(q).append(l).appendTo(f),this.prepareLayoutImpl(this.getMetaInfo("BarSetPriceBreak@tv-prostudies"),u,d.pbStyle,{valueColspan:2}),
|
|
this.bindControl(new ColorBinding(t,d.pbStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new ColorBinding(m,d.pbStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new ColorBinding(n,d.pbStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new ColorBinding(q,d.pbStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),this.bindControl(new ColorBinding(h,d.pbStyle.borderUpColor,!0,this.model(),
|
|
"Change Border Bar Up Color")),this.bindControl(new ColorBinding(e,d.pbStyle.borderDownColor,!0,this.model(),"Change Border Bar Down Color")),this.bindControl(new ColorBinding(g,d.pbStyle.borderUpColorProjection,!0,this.model(),"Change Projection Border Bar Up Color")),this.bindControl(new ColorBinding(l,d.pbStyle.borderDownColorProjection,!0,this.model(),"Change Projection Border Bar Down Color")),u=this.addColorPickerRow(a,"Up bars"),f=this.addColorPickerRow(a,"Down bars"),t=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 ColorBinding(u,d.kagiStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new ColorBinding(f,d.kagiStyle.downColor,!0,this.model(),"Change Bar Down Color")),this.bindControl(new ColorBinding(t,d.kagiStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new ColorBinding(h,
|
|
d.kagiStyle.downColorProjection,!0,this.model(),"Change Projection Bar Down Color")),a=this.addColorPickerRow(c,"Up bars"),u=this.addColorPickerRow(c,"Down bars"),f=this.addColorPickerRow(c,"Projection up bars"),t=this.addColorPickerRow(c,"Projection down bars"),this.prepareLayoutImpl(this.getMetaInfo("BarSetPnF@tv-prostudies"),c,d.pnfStyle),this.bindControl(new ColorBinding(a,d.pnfStyle.upColor,!0,this.model(),"Change Bar Up Color")),this.bindControl(new ColorBinding(u,d.pnfStyle.downColor,!0,this.model(),
|
|
"Change Bar Down Color")),this.bindControl(new ColorBinding(f,d.pnfStyle.upColorProjection,!0,this.model(),"Change Projection Bar Up Color")),this.bindControl(new ColorBinding(t,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();u=TradingView.createLineWidthEditor();f=this.addLabeledRow(b,"Line");$("<td>").appendTo(f).append(a);
|
|
$('<td colspan="2">').appendTo(f).append(u);t=this.createColorPicker();h=this.createColorPicker();m=TradingView.createTransparencyEditor(h);f=this.addLabeledRow(b,"Fill");$("<td>").appendTo(f).append(t);$("<td>").appendTo(f).append(h);$("<td>").appendTo(f).append(m);this.bindControl(new Z10(c,d.areaStyle.priceSource,null,!0,this.model(),"Change Price Source"));this.bindControl(new ColorBinding(a,d.areaStyle.linecolor,!0,this.model(),"Change Line Color"));this.bindControl(new SliderBinder(u,
|
|
d.areaStyle.linewidth,!0,this.model(),"Change Line Width"));this.bindControl(new ColorBinding(t,d.areaStyle.color1,!0,this.model(),"Change Line Color"));this.bindControl(new ColorBinding(h,d.areaStyle.color2,!0,this.model(),"Change Line Color"));this.bindControl(new SliderBinder(m,d.areaStyle.transparency,!0,this.model(),"Change Area Transparency"))};TradingView.LinetoolTemplatesList=function(a,b,c){this._toolName=a;this._applyTemplate=b;this._options=$.extend({saveAsText:"Save As...",applyDefaultText:"Apply Defaults"},c||{});this._list=[];D76.enabled("charting_library")||(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:'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(){Q83.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=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?Q83.showConfirm("Confirm replacing",'Do you realy want to replace "'+a+'"?',e):e()}};
|
|
TradingView.LinetoolTemplatesList.prototype.deleteAction=function(a){var b=this;runOrSignIn(function(){Q83.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)})};function W49(a,b,c){Z6.call(this,a,b);this._linetool=c;this._templateList=new TradingView.LinetoolTemplatesList(this._linetool._constructor,this.applyTemplate.bind(this))}inherit(W49,Z6);W49.prototype.applyTemplate=function(a){this._linetool.restoreTemplate(a);this.D99.model().updateSource(this._linetool);this.loadData()};
|
|
W49.prototype.createTemplateButton=function(a){var b=this;a=$.extend({},a,{getDataForSaveAs:function(){return b._linetool.template()}.bind(b)});return this._templateList.createButton(a)};
|
|
W49.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(0.5,0.5)};function clearRect(a,b,c,d,e,f){a.save();"undefined"==typeof FlashCanvas&&a.translate(-0.5,-0.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};Q61=function(a,b){this.w=a;this.h=b};Q61.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){d&&(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 q=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()},n=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"),u(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&&u(d)};Modernizr.touch?($(document.body).off("touchmove.chartgui"),$(document.body).off("touchend.chartgui"),
|
|
$(document.body).on("touchmove.chartgui",q),$(document.body).on("touchend.chartgui",n),l=setTimeout(function(){z(m)},500)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui"),$(document.body).on("mousemove.chartgui touchmove.chartgui",q),$(document.body).on("mouseup.chartgui touchend.chartgui",n));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(w){}}};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)}),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)}),navigator.msPointerEnabled&&window.MSGesture){var m=new MSGesture,q=!1,n=1,t=a.get(0);m.target=t;t.gesture=m;t.gesture.pointerType=null;t.pointers=[];m.pointerType=null;a.on("pointerdown",function(a){if(a.target===this)if(null===this.gesture.pointerType)this.gesture.target=
|
|
t,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=n*=1*
|
|
(c.originalEvent.scale-1)+1;q||1===c.originalEvent.scale||(q=!0,TradingView.processEvent(c,a,b,b.gestureStartEvent));q&&TradingView.processEvent(c,a,b,b.gestureChangeEvent)});a.on("MSGestureEnd",function(c){q=!1;n=1;TradingView.processEvent(c,a,b,b.gestureEndEvent)})}var u=function(d){a.off("mousemove.chartgui touchmove.chartgui");TradingView.processEvent(d,a,b,b.mouseLeaveEvent);c&&d.preventDefault()};a.mouseleave(u);var z=function(d){TradingView.processEvent(d,a,b,b.contextMenuEvent);c&&d.preventDefault()};
|
|
a.contextMenu(z)};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}};
|
|
Q19=function(a,b,c,d,e){this._url=a;this._overUrl=b;this._pressedUrl=c;this._disabledUrl=d;this._enabled=!0;this._pressedUrl||(this._pressedUrl=this._overUrl);this._content=$(document.createElement("img"));this._content.attr("src",a);this._content.attr("alt",e);this._content.attr("title",e);this._content.css("display","block");TradingView.setMouseEventHandler(this.content(),this)};Q19.prototype.content=function(){return this._content};
|
|
Q19.prototype.enable=function(a){(this._enabled=a)?this._content.attr("src",this._url):this._content.attr("src",this._disabledUrl)};Q19.prototype.isEnabled=function(){return this._enabled};Q19.prototype.setUrls=function(a,b,c,d,e){this._url=a;this._overUrl=b;this._pressedUrl=c;this._disabledUrl=d;this._content.attr("alt",e);this._content.attr("src",a);this._content.attr("title",e);this._content.mousecapture({down:function(){}})};
|
|
Q19.prototype.setTooltip=function(a){this._content.attr("title",a)};Q19.prototype.mouseEnterEvent=function(){this.isEnabled()&&this._content.attr("src",this._overUrl)};Q19.prototype.mouseLeaveEvent=function(){this.isEnabled()&&this._content.attr("src",this._url)};Q19.prototype.mouseUpEvent=function(){this.isEnabled()&&this._content.attr("src",that._overUrl)};
|
|
Q19.prototype.mouseDownEvent=function(){this.isEnabled()&&this._content.attr("src",this._pressedUrl)};Q74=function(a,b,c,d,e){Q19.call(this,a,b,c,d,e);this._toggled=!1};inherit(Q74,Q19);Q74.prototype.mouseDownEvent=function(){this._toggled=!this._toggled;this._content.attr("src",this._toggled?this._pressedUrl:this._overUrl)};
|
|
Q74.prototype.mouseEnterEvent=function(){this._mouseOver=!0;this._content.attr("src",this._toggled?this._pressedUrl:this._overUrl)};Q74.prototype.mouseLeaveEvent=function(){this._mouseOver=!1;this._content.attr("src",this._toggled?this._pressedUrl:this._url)};Q74.prototype.toggled=function(){return this._toggled};
|
|
Q74.prototype.toggle=function(a){this._toggled=a;this._content.attr("src",a?this._pressedUrl:this._url)};
|
|
Q76=function(a,b,c,d){this._container=$("<div>").css("position","relative");this.is_sigle=c;this.is_wide=d;c?d?Q74.call(this,TradingView.themeResourceFullPath("buttonex_left_single_wide.png"),TradingView.themeResourceFullPath("buttonex_left_over_single_wide.png"),TradingView.themeResourceFullPath("buttonex_left_pressed_single_wide.png"),"",b):Q74.call(this,TradingView.themeResourceFullPath("buttonex_left_single.png"),
|
|
TradingView.themeResourceFullPath("buttonex_left_over_single.png"),TradingView.themeResourceFullPath("buttonex_left_pressed_single.png"),"",b):Q74.call(this,TradingView.themeResourceFullPath("buttonex_left.png"),TradingView.themeResourceFullPath("buttonex_left_over.png"),TradingView.themeResourceFullPath("buttonex_left_pressed.png"),"",b);this._content.appendTo(this._container);this._icon_size=32;this._icon_offset_x=d?-1:3;this._icon_offset_y=3;this._icon=$('<span class="toolbarbuttonicon'+
|
|
(d?" wide":"")+'">').css({"background-position":-this._icon_size*a[0]-this._icon_offset_x+"px "+(-this._icon_size*a[1]-this._icon_offset_y)+"px"}).appendTo(this._container)};inherit(Q76,Q74);Q76.prototype.content=function(){return this._container};
|
|
Q76.prototype.setUrls=function(a,b){this._icon.css({"background-position":-this._icon_size*a[0]-this._icon_offset_x+"px "+(-this._icon_size*a[1]-this._icon_offset_y)+"px"});this._content.attr("title",b)};
|
|
Q11=function(a,b){this._coords=a;this._icon_size=32;this._content=$('<span class="toolbarpopupbutton">').css({display:"block","background-position":-this._icon_size*(a[0]+1)+"px "+-this._icon_size*a[1]+"px"}).attr("title",b);TradingView.setMouseEventHandler(this.content(),this);this._content.attr("title",b)};Q11.prototype.content=function(){return this._content};
|
|
Q11.prototype.setTooltip=function(a){this._content.attr("title",a)};Q11.prototype.mouseEnterEvent=function(){this._content.css({"background-position":-this._icon_size*(this._coords[0]+2)+"px "+-this._icon_size*this._coords[1]+"px"})};Q11.prototype.mouseLeaveEvent=function(){this._content.css({"background-position":-this._icon_size*(this._coords[0]+1)+"px "+-this._icon_size*this._coords[1]+"px"})};
|
|
Q75=function(a){this._toggled=!1;this._options=a;this._currentIndex=0;this.loadUserPreferences();this.prepareLayout();this._optionChanged=new Delegate;this._optionChanged.subscribe(this,function(a){a&&this.saveUserPreferences(a)})};function ToggleImageButtonExMouseHandler(a,b){this._popupWidget=a;this._button=b}
|
|
ToggleImageButtonExMouseHandler.prototype.mouseDownOutsideEvent=function(a){"block"===this._popupWidget.css("display")&&(this._popupWidget.css("display","none"),this._button.toggle(!1))};Q75.prototype.currentIndex=function(){return this._currentIndex};Q75.prototype.optionChanged=function(){return this._optionChanged};Q75.prototype.toggle=function(a){this._leftButton.toggle(a)};
|
|
Q75.prototype.prepareLayout=function(){var a=2>this._options.length;this._table=$("<table>");this._table.attr("cellspacing",0);this._table.attr("cellpadding",0);var b=$("<tr>");b.appendTo(this._table);this._leftTd=$("<td>");this._leftTd.appendTo(b);this._rightTd=$("<td>");this._rightTd.appendTo(b);var c=this._options[this._currentIndex],d=this;this._leftButton=new Q76(c.coords,c.name,a);this._leftButton.content().appendTo(this._leftTd);this._leftButton.content().click(function(){d._leftButton.toggled()?
|
|
d._optionChanged.fire(d._options[d._currentIndex]):d._optionChanged.fire(null)});this._popup=$("<table>");if(!a){this._rightButton=new Q74(TradingView.themeResourceFullPath("buttonex_right.png"),TradingView.themeResourceFullPath("buttonex_right_over.png"),TradingView.themeResourceFullPath("buttonex_right_pressed.png"));this._popup.addClass("buttonex-popup");for(a=0;a<this._options.length;a++){b=$("<tr>");b.appendTo(this._popup);b.mouseenter(function(){$(this).addClass("buttonex-popup-hover")});
|
|
b.mouseleave(function(){$(this).removeClass("buttonex-popup-hover")});var e=$("<td>");e.appendTo(b);var c=this._options[a],f=new Q11(c.coords);f.content().appendTo(e);b.click(c,function(a){d._popup.css("display","none");d._rightButton.toggle(!1);a=a.handleObj.data;d.selectOption(a);d._optionChanged.fire(a);d._leftButton.setUrls(a.coords,a.name);d._leftButton.toggle(!0)}).mouseenter({button:f},function(a){a.data.button.mouseEnterEvent()}).mouseleave({button:f},function(a){a.data.button.mouseLeaveEvent()});
|
|
e=$("<td>");e.appendTo(b);e.html(c.name)}this._rightButton.content().appendTo(this._rightTd);this._rightButton.content().click(function(){if(d._rightButton.toggled()){var a=d._leftButton.content().offset(),b=d._popup;TradingView.setAbsolutePos(b,{x:a.left,y:a.top+d._rightButton.content().height()+1});$(document.body).append(b);b.css("display","block");TradingView.setMouseEventHandler(b,new ToggleImageButtonExMouseHandler(b,d._rightButton),!1)}})}};
|
|
Q75.prototype.setCurrentCommand=function(a){this._popup.find("tr").removeClass("active");for(var b=0;b<this._options.length;b++)if(this._options[b].commandId===a){a=this._options[b];this._leftButton.setUrls(a.coords,a.name);this._leftButton.toggle(!0);this._popup.find("tr").eq(b).addClass("active");return}this._leftButton.toggle(!1)};
|
|
Q75.prototype.selectOption=function(a){for(var b=0;b<this._options.length;b++)if(this._options[b]===a){this._currentIndex=b;this._leftButton.setUrls(a.coords,a.name);break}};Q75.prototype.content=function(){return this._table};
|
|
Q75.prototype.loadUserPreferences=function(){for(var a=TVSettings.getJSON("chart.lineToolsPreferences",[]),b=0;b<this._options.length;b++)if(-1!==a.indexOf(this._options[b].commandId)){this._currentIndex=b;break}};
|
|
Q75.prototype.saveUserPreferences=function(a){for(var b=TVSettings.getJSON("chart.lineToolsPreferences",[]),c=0;c<this._options.length;c++){var d=b.indexOf(this._options[c].commandId);-1!==d&&b.splice(d,1)}b.push(a.commandId);TVSettings.setJSON("chart.lineToolsPreferences",b)};
|
|
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 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 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.Study.PLOT_LINE+"'>"+$.t("Line")+"</option>").appendTo(a);$("<option value='"+TradingView.Study.PLOT_LINE_WITH_BREAKS+"'>"+$.t("Line With Breaks")+"</option>").appendTo(a);$("<option value='"+TradingView.Study.PLOT_HISTOGRAM+"'>"+$.t("Histogram")+"</option>").appendTo(a);$("<option value='"+TradingView.Study.PLOT_CROSS+"'>"+$.t("Cross",{context:"chart_type"})+"</option>").appendTo(a);$("<option value='"+
|
|
TradingView.Study.PLOT_AREA+"'>"+$.t("Area")+"</option>").appendTo(a);$("<option value='"+TradingView.Study.PLOT_AREA_WITH_BREAKS+"'>"+$.t("Area With Breaks")+"</option>").appendTo(a);$("<option value='"+TradingView.Study.PLOT_COLUMNS+"'>"+$.t("Columns")+"</option>").appendTo(a);$("<option value='"+TradingView.Study.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)),n=e-h;h=e;b(n);d>=f?"function"==typeof c&&c():requestAnimationFrame(l)};requestAnimationFrame(l)};
|
|
Q14=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._load(b);TradingView.bindPopupMenu(this._container,null,{direction:"down",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};
|
|
Q14.prototype._openMenu=function(){this._submenu.trigger("popup-menu",[this._data])};Q14.prototype._onChangeInAnotherTab=function(){this.reload(this._data)};Q14.prototype.reload=function(a){this._quick_container.empty();this._load(a)};
|
|
Q14.prototype._load=function(a){var b=this;this._quicks=this._options.notShowQuicks?[]:TVSettings.getJSON(this._name+".quicks",this._options.defaultFavorites||[],!0);this._list=[];$.grep(a,function(a,b){return!a.separator}).forEach(function(a,d){var e={index:d,data:a,toQuickButton:$('<span class="to-quick" title=""></span>'),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.stopPropagation()}});"function"===typeof e.data.drop&&f.buttons.push({el:$('<span class="delete" title="Delete"></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()};
|
|
Q14.prototype._toggleFavorite=function(a,b,c){if(!this._options.notShowQuicks){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())}};Q14.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]};Q14.prototype._saveFavorite=function(){this._options.notShowQuicks||(TVSettings.setJSON(this._name+".quicks",this._quicks),TVXWindowEvents.emit(this._name+"-change"))};
|
|
Q14.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);if(c.icon){var e=$("<i></i>").appendTo(d);c.icon.image&&e.css("background-image",c.icon.image||"");c.icon.offset&&e.css("background-position","string"===typeof c.icon.quickOffset?c.icon.quickOffset:c.icon.quickOffset.x+"px "+c.icon.quickOffset.y+"px")}d.on("click",function(c){b._change(a);
|
|
0===b._quicks.length&&b._openMenu();c.preventDefault()});return d};Q14.prototype._removeButton=function(a){a.favorite_button&&(a.favorite_button.remove(),a.favorite_button=null)};
|
|
Q14.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")}};Q14.prototype._btnToggleActiveView=function(a,b){if(a){var c,d=a.data("item");d&&d.data&&d.data.icon&&(c=d.data.icon);b?(a.addClass("selected"),c=c.offsetActive?c.offsetActive:null):(a.removeClass("selected"),c=c.offset?c.offset:null);c&&a.children("i").css("background-position","string"===typeof c?c:c.x+"px "+c.y+"px")}};
|
|
Q14.prototype._addActive=function(a){this._quick_container.find(".just_active").remove();return this._createButton(a).appendTo(this._quick_container).addClass("just_active")};Q14.prototype._clearActive=function(){this._quick_container.find(".just_active").remove()};Q14.prototype._clearActive=function(){};Q14.prototype._setActive=function(a){if(this._active===a)return!1;this._active=a;this._markActive();return!0};
|
|
Q14.prototype._change=function(a){this._onSelect.fire(a.data.id);if(this._setActive(a))this._onChange.fire(a.data.id);else return!1};Q14.prototype.element=function(){return this._container};Q14.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");};Q14.prototype.onChange=function(){return this._onChange};
|
|
Q14.prototype.onSelect=function(){return this._onSelect};Q14.prototype.onResize=function(){return this._onResize};Q14.prototype.setValue=function(a){a=this._getItemByValue(a);this._setActive(a)};Q14.prototype.value=function(a){return this._active?this._active.data.value:void 0};
|
|
Q14.prototype.removeById=function(a,b){var c=$.grep(this._data,function(b){return b.id!=a});this.reload(c);"function"===typeof b&&b()};
|
|
TradingView.bindPopupMenu=function(a,b,c){var d,e,f;a=$(a);c=c||{};d=(c.event||"click")+".popup-menu";c.hideEvent&&(e=c.hideEvent+".popup-menu");var g=new Function,h=g,k={},l=function(d,e,l){function t(b){b=$(b.target).parents().andSelf();b.is(s)||b.is(a)||b.is(".charts-popup-tab-headers, .charts-popup-itemheader")||h()}function u(a){a=$(a.target).parents().andSelf();a.is(".charts-popup-tab-headers, .charts-popup-itemheader")||c.notCloseOnButtons&&a.is(".icon-save, .icon-delete")||h()}function z(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(){z(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(){z(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){z(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.disabled&&l.addClass("disabled");if("function"==typeof b.action){var m=
|
|
b.action;d=function(a){var c=$(a.target).parents().andSelf();c.is(n)||c.is(t)||(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?(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)):d=$('<span class="title-expanded"></span>').appendTo(l);b.html?d.html(b.html):d.text(b.title||"");if("function"==typeof b.deleteAction){var q=b.deleteAction;d=b.deleteAction.title||"Delete";var n=$('<span class="icon-delete">');n.attr("title",d);n.on("click",function(a){q.apply(l,arguments);a.preventDefault()});l.append(n)}if("function"==typeof b.saveAction){var w=b.saveAction;d=b.saveAction.title||
|
|
"Save";var t=$('<span class="icon-save">');t.attr("title",d);t.on("click",function(a){w.apply(l,arguments);a.preventDefault()});l.append(t)}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(l)h(),l=k.scrollTop;else return;h=function(){k.scrollTop=s.scrollTop();s.remove();a.removeClass("active open");a.data("popup-menu",null);$(document).off("click",u);$(document).off("mousedown",t);Modernizr.touch&&$(document).off("touchstart.chartgui",t);$(document).off("selectstart.popup-menu");h=g;c.onRemove&&c.onRemove()};a.addClass("active open");var s=$('<div class="charts-popup-list">');c.addClass&&s.addClass(c.addClass);
|
|
$.each(e,function(a){z(this,a,s)});setTimeout(function(){$(document).on("click",u);$(document).on("mousedown",t);Modernizr.touch&&$(document).on("touchstart.chartgui",t)},0);if(c.upAction)$(document).on("selectstart.popup-menu",function(){return!1});s.appendTo(document.body);e=$(window).width();var A=Math.min($(window).height(),$("body").height()),B=a.outerWidth(),w=a.outerHeight(),v=a.offset();l=$(window).scrollTop()||0;v.top-=l;popupWidth=s.outerWidth();popupHeight=s.outerHeight();viewportSpacing=
|
|
void 0!=c.viewportSpacing?c.viewportSpacing:10;f=c.popupSpacing?~~c.popupSpacing:1;popupDrift=c.popupDrift?~~c.popupDrift:0;popupPadBrd=popupHeight-s.height();direction=c.direction?c.direction:"down";reverse=!!c.reverse;"down"==direction&&100>$(window).height()-v.top-w-f&&(direction="up");switch(direction){case "down":case "up":"down"==direction?s.css("top",v.top+w+f+"px"):s.css("bottom",A-v.top+f+"px").css("top","auto");reverse?s.css("left",Math.max(v.left+popupDrift+B-popupWidth,viewportSpacing)+
|
|
"px").css("right","auto"):s.css("left",v.left+popupDrift+"px").css("right","auto");break;case "right":case "left":f=Math.max(f,4),"right"==direction?s.css("left",Math.floor(v.left+B+f)+"px").css("right","auto"):s.css("left",Math.floor(Math.max(v.left-popupWidth-f,viewportSpacing))+"px").css("right","auto"),reverse?s.css("top",Math.floor(Math.max(v.top+popupDrift+w-popupHeight,viewportSpacing))+"px"):s.css("top",Math.floor(v.top+popupDrift)+"px")}s.show();"up"==direction||{left:1,right:1}[direction]&&
|
|
reverse?"up"==direction?s.css("max-height",v.top-f-viewportSpacing-popupPadBrd+"px"):s.css("max-height",v.top+w-f-viewportSpacing-popupPadBrd+"px"):s.css("max-height",A-v.top-w-f-viewportSpacing-popupPadBrd+"px");c.careRightBorder&&parseInt(s.css("left"))+s.width()+viewportSpacing>e&&s.css("left",e-s.width()-viewportSpacing+"px").css("right","auto");c.careBottomBorder&&parseInt(s.css("top"))+s.height()+viewportSpacing>A+l&&s.css("top",A-s.height()-viewportSpacing+l+"px");var C;l=a.parents().andSelf();
|
|
for(e=l.size();e--;)if("fixed"===l.eq(e).css("position")){C=l.eq(e);break}C&&(C=s.offset(),s.css({position:"fixed",left:C.left-$(document).scrollLeft(),right:"auto"}));d&&d.preventDefault()};d&&a.bind(d,l);e&&a.bind(e,function(){h()});c.runOpened&&l()};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){var g=b?b:$.t("Save New Chart"),h=Q83.createDialog(g);b=function(){var b=h.find('input[name="name"]'),c=b.val(),d=[];if(e)for(var f=0;f<e.length;f++)if("bool"===e[f].type){var k=h.find('input[name="'+e[f].name+'"]');d.push(k[0].checked)}c?(a(c,d),Q83.destroy(g)):(Q83.showError($.t("Please enter chart name"),Q83.get(g)),b.focus());return!1};d=d||"";h.css("width","400px");h.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>');if(e)for(c=h.find(".tv-dialog-right"),d=0;d<e.length;d++)if("bool"===e[d].type){var k=$('<p class="tv-dialogs-name"></p>'),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>");
|
|
k.append(m,l).insertBefore(c)}h.find("form").submit(b);$('<a class="tv-button wide ok">'+$.t("OK")+"</a>").click(b).css({"margin-right":"5px"}).appendTo(h.find(".tv-dialog-right"));$('<a class="tv-button wide cancel">'+$.t("Cancel")+"</a>").click(function(){Q83.destroy(g)}).appendTo(h.find(".tv-dialog-right"));"function"===typeof f&&f(h);Q83.positionDialog(h,{left:$(window).width()/2-h.width()/2,top:$(window).height()/2-h.height()/2});Q83.applyHandlers(h);h.find('input[name="name"]').focus()};Q1=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=D76.enabled("plain_studymarket")?"Technical Analysis":"Built-ins";this.Z4=a;this._chart=a.activeChartWidget.value();this._options=$.extend({},this.DEFAULT_OPTIONS,c||
|
|
{});this.concretizeOptions();this._studies=this._market=null;this._packagesWithTabNames={};this._user=null;this._favs=[];this._pages={};this._tabs={};this._headers={};this.favsChanged=new Delegate;this.layoutChanged=new Delegate;this.visibilityChanged=new Delegate;this.setupMarketInfo();this.studiesReady=new $.Deferred;this.getStudyInfo();this.marketPagesReady=new $.Deferred;this.setUser(b);this.prepareLayout();this.attachHandlers();this._pubSearchPage=-1;this._pubSearchEntries=[];this._pubSearchDfd=
|
|
null;TVXWindowEvents.on("StudyFavoritesChanged",function(a){d._onExternalFavoritesChanged(JSON.parse(a))})};
|
|
Q1.prototype.DEFAULT_OPTIONS={onWidget:!1,hideMarketPages:!1,selectBasicPage:!0,minimized:!1,searchKeywords:{earning:/EPS/,earnings:/EPS/,"trailing twelve months":/TTM/},popularFundamentals:[{name:"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:"Profitability",
|
|
studies:["Script$EDGR_GROSS_MARGIN@tv-scripting","Script$EDGR_AFTER_TAX_MARGIN@tv-scripting","Script$EDGR_GROSS_PROFIT@tv-scripting"]},{name:"Dividend",studies:["Script$EDGR_DIVIDEND_YIELD@tv-scripting","Script$EDGR_DIVIDENDS_PAID@tv-scripting"]},{name:"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:"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"]}]};Q1.prototype._FAV_KEY="studyMarket.favorites";Q1.prototype._PAGE_KEY="studyMarket.page";Q1.prototype._MARKET_TAB_IS_OPEN_KEY="studyMarket.marketTabIsOpen";Q1.prototype._TECHNICAL_TAB_IS_OPEN_KEY="studyMarket.technicalTabIsOpen";
|
|
Q1.prototype._ECONOMY_TAB="Economy & Symbols";Q1.prototype._FILTER_KEY="studyMarket.filter";Q1.prototype.onCustomScriptModified=function(){this.getStudyInfo();this.resetCustomScriptPage();this.loadFavorites();this.updateSearchPage()};Q1.prototype.onPublishedScriptModified=function(){this.getStudyInfo();this.resetPublishedScriptPage();this.loadFavorites();this.updateSearchPage()};
|
|
Q1.prototype.setupMarketInfo=function(){this._market={products:pro.getStudies(),order:pro.getStudiesOrder()};this._market.order=$.grep(this._market.order,function(a){return"Script$EOTPRO"!=a})};Q1.prototype.concretizeOptions=function(){this._options.onWidget&&(this._options.hideMarketPages=!0,this._options.selectBasicPage=!0,this._options.minimized=!0)};
|
|
Q1.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()};
|
|
Q1.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}};Q1.prototype.getStudyInfo=function(){this._chart.withModel(this,function(){this.setupStudyInfo()})};
|
|
Q1.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()};
|
|
Q1.prototype.resolvePackageName=function(a){return a in this._subProductIds?this._subProductIds[a]:a};Q1.prototype.setUser=function(a){is_authenticated?this.setupUserData(a):this.setAnonymous()};Q1.prototype.setupUserData=function(a){this._user=a;this.loadFavorites();this.updateMarketPages()};Q1.prototype.setAnonymous=function(){this.setupUserData(null,[]);this.favsChanged.fire()};
|
|
Q1.prototype.isHidedStudy=function(a){return!!a.is_hidden_study};Q1.prototype.loadFavorites=function(){for(var a=TVSettings.getJSON(this._FAV_KEY,[]),b=[],c=0;c<a.length;c++){var d=StudyMetaInfo.cutFullId(a[c]);-1===b.indexOf(d)&&b.push(d)}this._favs=b;this.favsChanged.fire()};Q1.prototype.saveFavorites=function(){TVSettings.setJSON(this._FAV_KEY,this._favs)};
|
|
Q1.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_headers=this._widget.find(".insert-study-headers");this._widget.draggable(Q83._constrainDraggableOptionsIfNeeded({handle:".insert-study-title"})).css({position:"absolute",zIndex:17});this.preparePages();this._options.minimized&&this._widget.addClass("minimized");
|
|
this._w_pages.onScrollToEnd=new Delegate;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()};Q1.prototype.currentPage=function(){return this._pages[this._currentPageTitle]};
|
|
Q1.prototype.preparePages=function(){this.addSearchPage();D76.enabled("items_favoriting")&&this.addFavoritesPage();this.prepareBasicPage();this._options.minimized||D76.enabled("charting_library")||(this.preparePublishedScriptPage(),this.prepareCustomScriptPage());this.prepareMarketPages();this._options.minimized||D76.enabled("charting_library")||(this.prepareFundamentalsPage(),this.studiesReady.done(function(){this.search("",!0,!0)}.bind(this)));this.addEconomyPage();
|
|
this._scroll=new Q59(this._w_tabs_container,this._w_tabs,{showBottomShadow:!1})};Q1.prototype.addEconomyPage=function(){var a=this.addPage(this._ECONOMY_TAB,{showTitle:!0}),a=$('<div class="economy-page">').appendTo(a);this.addSymbolWidget=new AddSymbolWidget(this.Z4);this.addSymbolWidget.show();a.append(this.addSymbolWidget._widget)};Q1.prototype.addFavoritesPage=function(){this.addPage("Favorites",{showTitle:!0}).addClass("page-padded")};
|
|
Q1.prototype.prepareBasicPage=function(){var a=this,b=a.addPage(this._BASIC_STUDIES_PAGE_NAME,{packageName:this._BASIC_STUDIES_PACKAGE_NAME,technical:!D76.enabled("plain_studymarket"),showTitle:!0});this._basicPage=b;b.addClass("page-padded");a.studiesReady.done(function(){a.resetBasicPage()});a._options.selectBasicPage&&a.selectPage(this._BASIC_STUDIES_PAGE_NAME)};
|
|
Q1.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()})};
|
|
Q1.prototype.preparePublishedScriptPage=function(){var a=this,b=a.addPage("Public Library",{packageName:this._CUSTOM_STUDIES_PACKAGE_NAME,technical:!0,showTitle:!0,titleHref:"/p/",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)})};
|
|
Q1.prototype._onPublishedScriptPageShown=function(){0>this._pubSearchPage&&this._pubslishedScriptsLoadMore()};Q1.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})}};
|
|
Q1.prototype.resetBasicPage=function(){var a=this.getPage(this._BASIC_STUDIES_PAGE_NAME);this._studies&&studyMarket.preparePageStudies(a,this._studies[this._BASIC_STUDIES_PACKAGE_NAME]||[])};
|
|
Q1.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?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?studyMarket.preparePageStudies(a,b):studyMarket.appendTVScriptBtn(a)})}};Q1.prototype._createPublishedScriptMetaInfo=function(a){var b=this.Z4.activeChartWidget.value(),b=StudyMetaInfo.createMetaInfoStub(a,b.studyScriptingPkgVers);b.author=a.author;b.scriptName=a.scriptName;b.scriptDescription=a.description;b.agreeCount=a.agreeCount;b.imageUrl=a.imageUrl;return b};
|
|
Q1.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)}};
|
|
Q1.prototype.prepareFundamentalsPage=function(a,b){var c=this;a=this.addPage("Fundamentals",{packageName:"Script$EDGR",showTitle:!0});this.studiesReady.done(function(){function b(){for(var a=[],d=$.map(e,function(a){return a.id}),f=0;f<c._options.popularFundamentals.length;f++){var g=c._options.popularFundamentals[f];g.studies=g.studies.filter(function(a){return-1!=d.indexOf(a)}).map(function(a){return e.filter(function(b){return a===b.id})[0]});g.studies.length&&a.push(g)}return a}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%"),q=function(){for(var a=0,b=0;b<g.length;b++)a+=g[b].studies.length;return a}(),n=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">All Metrics</div></div>');h.append(f);a.prepend(k);a.append(h);for(k=h=0;h<g.length;h++){var t=g[h],u=n(t);k<q/2?l.append(u):m.append(u);k+=t.studies.length}}this.preparePageStudies(f,e)}}.bind(this))};
|
|
Q1.prototype.appendTVScriptBtn=function(a){var b=this;if(a){var c=$('<br><a class="add-custom-script-btn"> Create your first script now!</a>').on("click",function(a){b.hide();scriptEditor.show();a.stopPropagation()});a.empty();a.append("<p>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)}};
|
|
Q1.prototype.appendPubScriptBtn=function(a){a&&a.html("<p>No public library scripts were found.</p>")};
|
|
Q1.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))};
|
|
Q1.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)})};
|
|
Q1.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:RegExp("("+a.split("").map(function(a){return 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;D76.enabled("plain_studymarket")?
|
|
g.resolve([]):Q56.suggest(a).done(function(a){var b=[];a=a&&a.results||[];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 q=c[m],n=b.indexOf(q);-1!==
|
|
n&&(b.splice(n,1),b.unshift(q))}for(c=0;c<b.length;c++){q=b[c];n=[];if(q===d._PUBLISHED_STUDIES_PACKAGE_NAME)n=a;else for(var t=d._studies[q],m=0;m<t.length;m++){var u=t[m];if(f.length)for(var z=0;z<f.length;z++){var s=f[z].re;s.lastIndex=0;s.test(u.description_localized)&&n.push(u)}else n.push(u)}if(n.length){m=$('<div class="insert-study-items"><div>');t=q;switch(q){case d._BASIC_STUDIES_PACKAGE_NAME:t=d._BASIC_STUDIES_PAGE_NAME;break;case "Script$USER":t="My Scripts";break;case "Script$PUB":t=
|
|
"Public Library";break;default:q in d._packagesWithTabNames&&(t=d._packagesWithTabNames[t])}e.append('<div class="search-header">'+$.t(t)+"</div>");e.append(m);d.fillStudies(m,n,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")};Q1.prototype.updateSearchPage=function(){var a=this._tabs.search.find("input").val();this.search(a,!0,!0)};
|
|
Q1.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))};
|
|
Q1.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)};Q1.prototype.preparePageOffer=function(a,b){a.data("html",pro.prepareProductOfferPage(b));a.data("offer",b)};
|
|
Q1.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),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}}{{#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})).data("title",d).appendTo(this._w_headers).hide();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?(c=this._getOrCreateTechincalTab().find("ul"),c.append(f)):b.market?(c=this._getOrCreateMarketTab().find("ul"),c.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};Q1.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">Marketplace Add-ons</div><ul></ul></li>');this._w_tabs.append(this._w_market_tabs);this.toggleMarketTabs(a);return this._w_market_tabs};
|
|
Q1.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};
|
|
Q1.prototype.hide=function(){this._widget.hide();this.visibilityChanged.fire(!1);TradingView.keyboardBinder.removeListener("StudyMarket");var a=Q83.dialogs.indexOf(this._widget);-1!==a&&Q83.dialogs.splice(a,1)};
|
|
Q1.prototype.show=function(){this._widget.show();this._widget.css("z-index",Q83.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();this._search_input.focus();this._search_input[0].value=String.fromCharCode(a.charCode);return!0}.bind(this));Q83.dialogs.push(this._widget)};Q1.prototype.isVisible=function(){return this._widget.is(":visible")};
|
|
Q1.prototype.updateLayout=function(a){var b=this._widget.find(".insert-study-body");b.css("height","");this._widget.css("width","");var c=Q83.calcHeight(this._widget.height(),b.height());b.height(c);Q83.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})};Q1.prototype.getPage=function(a){a=a.toLowerCase();return this._pages[a]};Q1.prototype.focusAddSymbolInput=function(a){a==this._ECONOMY_TAB.toLowerCase()&&this.addSymbolWidget.focus()};
|
|
Q1.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(_title in this._pages){a=b===_title;var c=this._pages[_title];this._headers[_title]&&this._headers[_title].toggle(a);c.toggle(a);this._tabs[_title].toggleClass("active",a);a&&(c.data("html")&&(c.html(c.data("html")),
|
|
c.data("html",null)),c.trigger("show-page"),a=this._tabs[_title].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)};
|
|
Q1.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));D76.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 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()})};Q1.prototype.selectThisPage=function(a){var b=$(a.currentTarget).data("title");b&&"search"!=b&&this.selectPage(b);a.stopPropagation()};
|
|
Q1.prototype.marketTabsClickHandler=function(a){a.stopPropagation();this.toggleMarketTabs()};
|
|
Q1.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))};
|
|
Q1.prototype.technicalTabsClickHandler=function(a){a.stopPropagation();this.toggleTechnicalTabs()};
|
|
Q1.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))};
|
|
Q1.prototype.toggleItem=function(a){a=$(a.target).parent().data("study");this.toggleFavorite(a.id);this.toggleEverywhere(a.id);return!1};Q1.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?StudyMetaInfo.cutFullId(e.id)==a:!1}).find(".fav").toggleClass("in-fav",b).attr("title",this.favTitle(b))};
|
|
Q1.prototype.toggleFavorite=function(a){this.isFavorite(a)?this.removeFavorite(a):this.addFavorite(a)};Q1.prototype.isFavorite=function(a){a=StudyMetaInfo.cutFullId(a);return-1!=this._favs.indexOf(a)};
|
|
Q1.prototype.addFavorite=function(a){a=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])&&Q56.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};Q1.prototype.removeFavorite=function(a){a=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};
|
|
Q1.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(StudyMetaInfo.cutFullId(h[k].id)==g){d.push(h[k]);break}}e.length?Q56.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.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()}};
|
|
Q1.prototype.hasFavorites=function(){return!!this._favs.length};Q1.prototype.hasVisibleFavorites=function(){return!!this.getVisibleFavorites().length};Q1.prototype.getVisibleFavorites=function(){return this.checkExcludePackageStudies(this._favs)};
|
|
Q1.prototype.viewSourceCode=function(a){a.stopPropagation();this.hide();var b=$(a.target).parent().data("study");this.studyIsPublishedScript(b)?window.scriptEditor.show({scriptIdPart:b.scriptIdPart,scriptSource:b.TVScriptSourceCode}):scriptLib.requestBuiltinAndUserScripts(function(a){for(var d=a.length;d--;)if(a[d].scriptIdPart===b.scriptIdPart){window.scriptEditor.show(a[d]);break}})};
|
|
Q1.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)};
|
|
Q1.prototype.sortStudies=function(a){return a.sort(function(a,c){a=a.scriptName||a.description_localized;c=c.scriptName||c.description_localized;return a>c?1:a<c?-1:0})};Q1.prototype.fillStudies=function(a,b,c){a.empty();b.forEach(function(b){b?li=this.createStudyListItem(b,c):(li=document.createElement("li"),li.className="placeholder");a.append(li)},this)};
|
|
Q1.prototype.createStudyListItem=function(a,b){var c=document.createElement("li");$.data(c,"study",a);var d=a.description_localized||$.t(a.scriptName||"",{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 q=k[m].length;m%2&&(f[l]=!0);l+=q}else for(l=0;l<k[0].length;l++)f[k.index+
|
|
l]=!0}}g='<span class="text">'+d.replace(/./g,function(a,b){"<"===a?a="<":"&"===a?a="&":'"'===a&&(a=""");f[b]&&(a='<span class="match">'+a+"</span>");return a})+"</span>";D76.enabled("items_favoriting")&&(g+='<span class="fav'+(e?" in-fav":"")+' apply-common-tooltip" title="'+this.favTitle(e)+'">');c.innerHTML=g;a.author&&a.author.username&&$('<span class="author">').text(" - by "+a.author.username).appendTo(c);a.imageUrl&&($('<div class="open-chart-popup apply-common-tooltip" title="Read more...">...</div>').appendTo(c).click(function(b){b.stopPropagation();
|
|
b.preventDefault();TradingView.historyManager.push(new TradingView.HistoryManager.ChartPage(a.imageUrl,d))}),$(c).find(".text, .author").css("z-index",1));a.agreeCount&&$('<span class="agrees apply-common-tooltip" title="Total agrees">').text(a.agreeCount+" like"+(1<a.agreeCount?"s":"")).appendTo(c);!TradingView.isMobileView&&a.TVScriptSourceCode&&(c.className="custom-script",$('<span class="source apply-common-tooltip" title="Source code"></span>').appendTo(c));D76.enabled("graying_disabled_tools_enabled")&&
|
|
Z15.studiesAccessController.isToolGrayed(a.description)&&(c.className+=" grayed");return c};Q1.prototype.favTitle=function(a){return a?$.t("Remove from favorites"):$.t("Add to favorites")};
|
|
Q1.prototype.insertThisStudy=function(a){a=$(a.target).closest("li");if(!a.hasClass("placeholder")){var b=a.data("study");if(D76.enabled("graying_disabled_tools_enabled")&&Z15.studiesAccessController.isToolGrayed(b.description))Z16.emit("onGrayedObjectClicked",{type:"study",name:b.description});else return a.highlight(this.HIGHLIGHT_STUDY_NUM_FLICKS),this.insertStudy(b),!1}};
|
|
Q1.prototype.insertStudy=function(a){var b=this.Z4.activeChartWidget.value();b&&(a=StudyMetaInfo.replaceWithFullStudyMetaInfo(b.model().studiesMetaData(),a),b.insertStudyOrShowDialog(a),this._is_on_chart=!0)};Q1.prototype.subscribePackage=function(a){(a=$(a.target).closest(".insert-study-pages > div").data("offer"))&&TradingView.visitPaymentPage(a.id)};Q1.prototype.onLoginStateChange=function(a){a||this.setUser(window.user)};
|
|
Q1.prototype.getStudyList=function(a){if(!this.studiesReady.isResolved())return[];var b=[],c;for(c in this._studies)if(c==this._BASIC_STUDIES_PACKAGE_NAME||pro.hasPackage(c))this._studies[c].forEach(function(a){b.push(a)}),a&&b.push({separator:!0});a&&b.splice(b.length-1,1);return b};
|
|
Q1.prototype.getStudyPackageName=function(a){if(a&&a.id){var b=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}};
|
|
Q1.prototype.studyIsUserTVScript=function(a){if(a&&a.id)return"Script$USER"===this.getStudyPackageName(a)};Q1.prototype.studyIsPublishedScript=function(a){if(a&&a.id)return"Script$PUB"===this.getStudyPackageName(a)};Q1.prototype.selectSearchPage=function(){this.selectPage("search");this._clearInput()};
|
|
Q1.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}}};Q1.prototype._clearInput=function(){this._search_input.val("");"search"===this._currentPageTitle&&this._search_input.val("").trigger("input").focus()};
|
|
Q1.prototype._loadNextPubSearchPage=function(){var a=this;if(a._pubSearchDfd)return a._pubSearchDfd;var b=a._pubSearchPage+1;a._pubSearchDfd=Q56.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};
|
|
Q1.prototype._onExternalFavoritesChanged=function(a){for(var b=[],c=0;c<a.length;c++){var d=StudyMetaInfo.cutFullId(a[c]);-1===b.indexOf(d)&&b.push(d)}this._favs=b;this.saveFavorites();this.favsChanged.fire()};TradingView.deleteStudyTemplate=function(a,b){$.post("/remove-study-template/",{name:a},b)};Q65=function(a){this._options=a||{};this.Z4=this._options.Z5;this._SAVE_AS_TITLE="Save Study Template As...";this._list=[];this._loaded=!1;this._favoredList=this._$wrapper=null;this._onFirstLoad=new Delegate;this.refreshStudyTemplateList(function(){this._loaded=!0;this._onFirstLoad.fire()}.bind(this))};
|
|
Q65.prototype.appendMenuButtonTo=function(a){if(a){var b=function(){this._$wrapper=a;this._generateFavoriteList()};this._loaded?b.call(this):this._onFirstLoad.subscribe(this,b);this.onFavoriteListResize=new Delegate}};Q65.prototype.refreshStudyTemplateList=function(a){var b=this;TradingView.getStudyTemplatesList(function(c){b._list=c||[];"function"===typeof a&&a()})};
|
|
Q65.prototype._generateFavoriteList=function(){this._favoredList=new Q14("StudyTemplates",this._listPreparedForFavorite(),{addClass:"study-template-widget",popupAddClass:"study-template-popup",notShowActive:!0,popupSpacing:this._options.popupSpacing,notShowQuicks:this._options.notShowQuicks,tooltip:"Study Templates",addTooltipClass:"apply-common-tooltip"});this._favoredList.element().appendTo(this._$wrapper);this._favoredList.onSelect().subscribe(this,function(a){a!=
|
|
this._SAVE_AS_TITLE&&this.applyStudyTemplate(a)});this._favoredList.onSelect().subscribe(this,function(a){a===this._SAVE_AS_TITLE&&this.showSaveAsDiaolg()});this._favoredList.onResize().subscribe(this.Z4,this.Z4.updateLayout);this._favoredList.onResize().subscribe(this.onFavoriteListResize,this.onFavoriteListResize.fire)};
|
|
Q65.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:a,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)).concat([{separator:!0}]));
|
|
return d=d.concat(e(a))};Q65.prototype.applyStudyTemplate=function(a){var b=this.Z4.activeChartWidget.value();TVSettings.setValue("defaultStudyTemplate",a);$.get("/study-template/?templateName="+encodeURIComponent(a),function(c){TradingView.trackEvent("GUI","Load Study Template");b.model().model().restoreStudyTemplate(JSON.parse(c.content),a)})};
|
|
Q65.prototype.showSaveAsDiaolg=function(){var a=this,b=this.Z4.activeChartWidget.value(),c=function(c,d){c=clean(c);var g=d[0],g=JSON.stringify(b.model().model().studyTemplate(g)),h={name:c,content:g},g=function(){$.post("/save-study-template/",h,function(b){b.error||(TVSettings.setValue("defaultStudyTemplate",c),a.refreshFavoriteDropdownMenu())}).error(function(a){console.error(a.responseText)})};-1!=$.inArray(c,a.plainList())?Q83.showConfirm("Confirm replace",
|
|
'Do you realy want to replace "'+c+"\"?<br><small>Note: default study templates won't be removed permanently</small>",g):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:"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)};Q65.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))})};
|
|
Q65.prototype.deleteStudyTemplate=function(a){var b=this,c="Do you realy want to delete "+(a?'"'+a+'"':"")+" study template?";runOrSignIn(function(){Q83.showConfirm("Study Template",c,function(){TradingView.deleteStudyTemplate(a,function(){setTimeout(function(){b.refreshFavoriteDropdownMenu()},0)})})})};Q65.prototype.container=function(){return this._favoredList?this._favoredList._container:null};Q65.prototype.list=function(){return this._list};
|
|
Q65.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})};var 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);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||[]};Action.prototype.callbacks=function(){return this._callbacks};Action.prototype.callbackContext=function(){return this._callbackContext};Action.prototype.setCallbackContext=function(a){this._callbackContext=a};Action.prototype.hasSubActions=function(){return this.subActions&&this.subActions.length};Action.prototype.setChecked=function(a){this.checked=a};Action.prototype._toggleChecked=function(){this.checked=!this.checked};
|
|
Action.prototype.setVisible=function(a){this.visible=a};Action.prototype.setEnabled=function(a){this.enabled=a};Action.prototype.disable=function(){this.setEnabled(!1)};Action.prototype.enable=function(){this.setEnabled(!0)};Action.prototype.setShortCut=function(a){a&&(this.shortcut=a,this._bindShortCut())};
|
|
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})};Action.prototype.setIconVisible=function(a){this.iconVisibleInMenu=a};Action.prototype.executeCallback=function(a){this._lastEvent=a;this._toggleChecked();this._callbacks.fire(this)};ActionSeparator=function(){Action.call(this);this.subActions=this.font=null;this.htmlclass="action-separator"};
|
|
inherit(ActionSeparator,Action);ActionPlaceholder=function(a){Action.call(this);this.deferred=a};inherit(ActionPlaceholder,Action);var 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 ContextMenu.Menu(a,b,c);this.instances.push(a);return a},createMenuFromActions:function(a,b){var c=new ContextMenu.Items(a,b);this.instances.push(c);return c},hideAll:function(){for(instance in this.instances)this.instances[instance].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}ContextMenu.Item=function(a,b){this.action=a;this._parentMenu=b};ContextMenu.Item.prototype._createIconTag=function(){var a=this._iconTagAttributes();this.jqIcon=HTMLHelper.Element.create(ContextMenu.ICON_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqIcon};ContextMenu.Item.prototype._createDeleteButton=function(){if(!this.action.deleteButton)return null;
|
|
var a=this,b=this.action.deleteButton.action,e=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)};ContextMenu.Item.prototype._createTextTag=function(){var a=this._textTagAttributes();this.jqText=HTMLHelper.Element.create(ContextMenu.TEXT_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqText};ContextMenu.Item.prototype._createRightTag=function(){var a=this._rightTagAttributes();
|
|
this.jqRight=HTMLHelper.Element.create(ContextMenu.RIGHT_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqRight};ContextMenu.Item.prototype._createSubmenuTag=function(){var a=this._submenuTagAttributes();this.jqSubmenu=HTMLHelper.Element.create(ContextMenu.SUBMENU_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqSubmenu};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};ContextMenu.Item.prototype._textTagAttributes=function(){return{"class":"text",html:this.action?this.action.text:""}};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"))};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};ContextMenu.Item.prototype._submenuTagAttributes=function(){var a={};this.action&&this.action.hasSubActions()?a["class"]="submenu-arrow":a["class"]="context-menu spacer";return a};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};ContextMenu.Item.prototype._createRow=
|
|
function(){var a=this._rowTagAttributes();this.jqRow=HTMLHelper.Element.create(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)})}};ContextMenu.Item.prototype.showSubmenu=function(a){this._parentMenu.closeOtherSubmenus(this);if(!this.action||this.action.hasSubActions())this._menu||(this._menu=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)};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(" ")}};ContextMenu.Item.prototype.appendCallback=function(){var a=this;this.jqRow.click(function(b){a.action.enabled&&a.action.executeCallback(b)})};ContextMenu.Item.prototype.getTopLevelMenu=function(){return b(this)};ContextMenu.ItemPlaceholder=function(a,b){this.action=a;this._parentMenu=b};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]);ContextMenu.Menu.renderItem(a,g)}}).always(function(){b.jqRow.hide()});return this.jqRow};ContextMenu.ItemPlaceholder.prototype._createIconTag=function(){var a=this._iconTagAttributes();this.jqIcon=HTMLHelper.Element.create(ContextMenu.ICON_CELL_TAG,a);this.jqIcon.addClass("context-menu");return this.jqIcon};ContextMenu.ItemPlaceholder.prototype._createRow=function(){var a=this._rowTagAttributes();this.jqRow=HTMLHelper.Element.create(ContextMenu.ITEM_ROW_TAG,a);this.jqRow.append(this._createIconTag());
|
|
this.jqRow.addClass("context-menu")};ContextMenu.ItemPlaceholder.prototype._rowTagAttributes=function(){var a=[];this.action&&a.push("spinner");return{"class":a.join(" ")}};ContextMenu.ItemPlaceholder.prototype.highlight=function(a){};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}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])};ContextMenu.Menu.prototype.addItem=function(a){a=a instanceof ActionPlaceholder?new ContextMenu.ItemPlaceholder(a,
|
|
this):new ContextMenu.Item(a,this);this.m_items.push(a);return a};ContextMenu.Menu.renderItem=function(a,b){a.append(b.render(a))};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)};ContextMenu.Menu.prototype.isShown=function(){return null!==this.jqMenu};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];ContextMenu.Menu.renderItem(b,e)}}else for(d in this.jqMenu=b=HTMLHelper.Element.create(ContextMenu.MENU_TAG,b),this.m_items)e=this.m_items[d],ContextMenu.Menu.renderItem(b,e);return this.jqMenu};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};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);HTMLHelper.unbindContextMenu(this.jqMenu);this._setCoords(b);return this.jqMenu};ContextMenu.Menu.prototype.show=function(a,b){this.deploy(a,b).show()};
|
|
ContextMenu.Menu.prototype.hide=function(){this.isShown()&&this.destroy()};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()};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)};ContextMenu.Menu.prototype._wrapper=function(){var c=this,
|
|
d=ContextMenu.WRAPPER_ATTRIBUTES;this._parentMenuItem?this.m_wrapper=HTMLHelper.Element.create(ContextMenu.WRAPPER_TAG,d):(this.m_wrapper=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};ContextMenu.Menu.prototype.wrapper=function(a){return this.m_wrapper||this._wrapper()}})(jQuery);TradingView._defaultChartSymbol="FX:SPX500";
|
|
Q7=function(a){var b=this;TradingView.drawingState.init();var c=this;TradingView.drawingState.tool.subscribe(function(a){if(c.D99){c.D99.model().setCurrentTool(a);if(TradingView.isMobile.any()){var b=c._paneWidgets[0];if(D46.isLineTool(a)&&"LineToolBrush"!==a){a=0.5*c.D99.model().timeScale().width();var d=0.5*b._state.defaultPriceScale().height();c.D99.model().setCurrentPosition(a,d,b._state);b._updateTooltip(a,d)}else b._hideTooltip()}c.D99&&TradingView.isMobile.any()&&
|
|
c.D99.model().crossHairSource().updateAllViews()}});this._options=a=a||{};var d=a.jqParent,e=a.sizeFunc,f=a.content,g=a.readOnly,h=a.containsData,k=a.onWidget,l=a.onCmeWidget,m=a.timezone,q=a.withDateRanges,n=a.hideSymbolSearch,t=a.defSymbol,u=a.defInterval;!Q21||Q21.isMinute(a.defInterval)||Q21.isDWM(a.defInterval)||(u=void 0);var z=-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.Z4=a.Z5||null;this._withDateRanges=("undefined"===typeof q?!g:!!q)&&D76.enabled("timeframes_toolbar");this._jqParent=void 0!==d?d:$(document.body);this._setContent(f);this._readOnly=g;this._containsData=h;this._defSymbol=t;this._onCmeWidget=(this._onWidget=!!k)?!!l:!1;this._sizeFunc=e||function(){var a=b._jqParent.width(),c=b._jqParent.height()-(b._withDateRanges?22:0);return new TradingView.Rect(0,
|
|
0,a,c)};this._hideSymbolSearch=n;this._jqMainDiv=null;this._rect=this._sizeFunc();this._jqMainTable=null;this._paneWidgets=[];this._paneSeparators=[];this._timeAxisWidget=null;this._frameTime=30;this.D99=null;this._metaInfo={};this.Z1=new W51("chartproperties");this.Z1.mainSeriesProperties.merge(defaults("chartproperties.mainSeriesProperties"));this.Z1.mainSeriesProperties.merge({visible:!0,symbol:t?t:TradingView._defaultChartSymbol,timeframe:"",onWidget:this._onWidget,
|
|
interval:u||"D",style:z,lineStyle:{styleType:factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}});m&&TradingView.timezoneIsAvailable(m)&&this.Z1.timezone.setValue(m);this.onCmeWidget()&&this.Z1.timezone.setValue("exchange");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 ChartSession(Z15);this.lhsPriceAxisWidthChanged=new Delegate;this.rhsPriceAxisWidthChanged=new Delegate};Q7._nextMetadataId=1;
|
|
Q7.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;d<c.length;d++)this._studiesMigrations.append(c[d]);for(var e=a.params[1].metainfo,d=0;d<e.length;d++)Q0._fixInputsMaxValue(null,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));
|
|
TradingView.Z17("alerts")&&!b.onWidget()&&this._setAlertsStudiesList(e);e=e.concat(this.privateMetaInfo(TradingView.ESDTimelineGenerator));void 0!=PineAddons?(a=Q7._filterAuthorizedMetaInfo(PineAddons.TimWestStudiesMetaInfo),e=e.concat(a),a=Q7._filterAuthorizedMetaInfo(PineAddons.SpyderCrusherStudiesMetaInfo),e=e.concat(a)):console.error("PineAddons is undefined. All Pine Script products will be unavailable");(window.scriptLib?window.scriptLib.requestBuiltinAndUserScripts():
|
|
$.Deferred().resolve([])).done(function(a){b._onScriptSources(a,e)})}};Q7.prototype._setAlertsStudiesList=function(a){this._alertsStudiesList=$.map($.grep(a,function(a){return a.plots&&a.plots.length}),function(a){return a.id})};
|
|
Q7.prototype.canCreateAlertForDataSource=function(a){function b(a){a instanceof Q58&&(a=a.bars());a instanceof 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&&!isNaN(e))return!0}}return!1}if(this.onWidget()||!TradingView.Z17("alerts"))return!1;var c=a===this.D99.mainSeries(),d=a instanceof
|
|
TradingView.Study,e=a&&a.data&&a.data()&&a.data().isEmpty&&!a.data().isEmpty()&&b(a.data()),f=a.metaInfo&&a.metaInfo()&&a.metaInfo().isTVScript,g=a.metaInfo&&a.metaInfo()&&-1!=$.inArray(a.metaInfo().fullId,this._alertsStudiesList);return a.uniqueId&&a.uniqueId()&&(c||d&&e&&(f||g))};Q7._filterAuthorizedMetaInfo=function(a){for(var b=[],c=0;c<a.length;++c){var d=a[c],e=StudyMetaInfo.parseIdString(d.id).productId;pro.hasPackage(e)&&b.push(d)}return b};
|
|
Q7.prototype.privateMetaInfo=function(a){return a?(new a(StudyMetaInfo.CURRENT_METAINFO_FORMAT_VERSION)).generateMetaInfo():[]};
|
|
Q7.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=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.logDebug("Loading script: '"+f+"'.");var g=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++)StudyMetaInfo.addStudyMetaInfo(this._studiesMetaData,b[d]);StudyMetaInfo.sortStudiesMetainfo(this._studiesMetaData);this._init();this.chartWidgetInitialized.fire()};
|
|
Q7.prototype._init=function(){var a=this;!this._containsData&&this._content&&this._content.timeScale&&!this._content.timeScale.m_lastVisibleBar&&(this._content.timeScale.m_rightOffset=this.Z1.timeScale.rightOffset.value());this.initColors();this._makeDefaultGui();this._makeDefaultModel();this._chartSession&&this._chartSession.connected()&&this.D99.restart();this._content&&(this.initColors(),this._updateGui(),this.update(),this.paint());a.D99.mainSeries().marketStatus.subscribe(function(b){a.indicatorImage&&
|
|
a._updateDataAndMarketStatus(b,a.D99.mainSeries().status())},{callWithLast:!0});this._resizeHandler=function(){this._rect=this._sizeFunc();TradingView.setAbsoluteRect(this._jqMainDiv,this._rect);this._adjustSize();this.D99&&this.D99.mainSeries().requestMoreData();this.paint()}.bind(this);this.chartWidgetInitialized.subscribe(this,this._resizeHandler);$(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=2*(a/f-0.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.Z17("esdindicatorfeature")&&this.initESDTimelineWidget();
|
|
this.setAutoScaleOnSymbolChange();this.readOnly()||this._hideSymbolSearch||Q69.registerDialogKeypressHandler(this);this.adaptOnChartLogo(this.Z1.paneProperties.background.value())};Q7.prototype._initBarsMarksSources=function(){var a=this;this.withModel(this,function(){this.model().barsMarksSources().map(function(b){b.onNeedRepaint.subscribe(a,a.paint)})})};Q7.prototype.initESDTimelineWidget=function(){new TradingView.ESDTimelineWidget(this)};
|
|
Q7.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)})})};
|
|
Q7.prototype.initColors=function(){this.Z1.paneProperties.background.listeners().subscribe(this,Q7.prototype.setBackgroundColor);this.Z1.paneProperties.gridProperties.color.listeners().subscribe(this,Q7.prototype.redrawPanes);this.Z1.scalesProperties.lineColor.listeners().subscribe(this,Q7.prototype.setScaleLineColor);this.Z1.scalesProperties.textColor.listeners().subscribe(this,
|
|
Q7.prototype.setScaleTextColor)};Q7.prototype.paneWidgets=function(){return new List(this._paneWidgets)};Q7.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};
|
|
Q7.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};Q7.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};
|
|
Q7.prototype.timeAxisByCanvas=function(a){return a===this._timeAxisWidget.canvas||a===this._timeAxisWidget.top_canvas?this._timeAxisWidget:null};Q7.prototype.properties=function(){return this.Z1};Q7.prototype.emulateCriticalError=function(){this._chartSession.removeSeries(-1,null)};Q7.prototype.readOnly=function(){return this._readOnly};Q7.prototype.onDisconnected=function(){return this._disconnected};
|
|
Q7.prototype.onReconnectBailout=function(){return this._reconnectBailout};Q7.prototype.onConnected=function(){return this._connected};Q7.prototype.onRedrawPanes=function(){return this._redrawPanes};Q7.prototype.modelCreated=function(){return this._modelCreated};
|
|
Q7.prototype.setResolution=function(a){if(this.D99){var b=this.D99.mainSeries().properties().interval;this.D99.setScreenChartProperty(b,a,this,$.t("Change Resolution"))}else this.Z1.mainSeriesProperties.merge({interval:a})};Q7.prototype.getResolution=function(){return this.D99?this.D99.mainSeries().properties().interval.value():this.Z1.mainSeriesProperties.interval.value()};
|
|
Q7.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;props={inputs:{symbol:a},style:e};study=d.find(function(a){return"Overlay@tv-basicstudies"==a.id});c.insertStudy(study,props,b)};Q7.prototype.addSymbolDialog=function(){Q83.showAddSymbolDialog(this,{overlayOption:!0,callback:this.addSymbol.bind(this)})};
|
|
Q7.prototype.updateActions=function(){function a(a){function d(){TradingView.showChartNameDialog(function(a){if(a){var c={name:a,content:JSON.stringify(b.D99.model().theme())};$.post("/save-theme/",c).error(function(a){document.write(a.responseText)});b.D99._lastLoadedTheme=a}},"Save theme as...","Theme name",128)}c.applyColorTheme.subActions||(c.applyColorTheme.subActions=[]);var e=c.applyColorTheme.subActions;e.splice(0,e.length);if(is_authenticated){var f=new Action({text:$.t("Save As...")});
|
|
f.callbacks().subscribe(null,d);e.push(f);e.push(new ActionSeparator)}a&&a.length?$.each(a,function(a,c){function d(a){return function(){Q83.showConfirm("Theme","Do you realy want to delete "+(a?'"'+a+'"':"")+" theme?",function(){$.post("/remove-theme/",{name:a}).error(function(a){document.write(a.responseText)})});this._parentMenu._parentMenuItem._parentMenu.destroy();return!1}}var f=new Action({text:c});f.callbacks().subscribe(null,function(){$.getJSON("/theme/?themeName="+encodeURIComponent(c),
|
|
function(a){b.model().model().restoreTheme(JSON.parse(a.content))})});is_authenticated&&(f.deleteButton={action:d(f.text)});e.push(f)}):e.push(new Action({text:"No color themes saved",enabled:!1}))}for(var b=this,c=this.actions(),d=this.D99.Z18(),e=!1,f=!1,g=0,h=d.size();g<h;g++){var k=d.item(g);isInherited(k.constructor,D46)&&(e=!0);isInherited(k.constructor,TradingView.Study)&&k.removeByRemoveAllStudies()&&(f=!0)}this._readOnly||(c.paneRemoveAllStudies&&c.paneRemoveAllStudies.setEnabled(f),
|
|
c.paneRemoveAllDrawingTools&&c.paneRemoveAllDrawingTools.setEnabled(e));a(TradingView.getThemesList(a));if(window.studyTemplates){d=studyTemplates.plainList("custom");e=studyTemplates.plainList("default");c.applyStudyTemplate.subActions||(c.applyStudyTemplate.subActions=[]);var l=c.applyStudyTemplate.subActions;l.splice(0,l.length);f=new Action({text:studyTemplates._SAVE_AS_TITLE});f.callbacks().subscribe(studyTemplates,studyTemplates.showSaveAsDiaolg);l.push(f);l.push(new ActionSeparator);d.length||
|
|
e.length?(d.length&&($.each(d,function(a,b){var c=new Action({text:b});c.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(b)});c.deleteButton={action:function(a){return function(){studyTemplates.deleteStudyTemplate(a);this._parentMenu._parentMenuItem._parentMenu.destroy();return!1}}(c.text)};l.push(c)}),l.push(new ActionSeparator)),$.each(e,function(a,b){var c=new Action({text:b});c.callbacks().subscribe(studyTemplates,function(){this.applyStudyTemplate(b)});l.push(c)})):l.push(new Action({text:"No study templates saved",
|
|
enabled:!1}))}var m=[];TradingView.availableTimezones.forEach(function(a){var b=this,c=function(){return a.id===b.model().model().properties().timezone.value()};if(a.separator)indicatorSubActions.push(new ActionSeparator);else{var d=new 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);c.applyTimeZone.subActions=m;c.addToWatchlist.text=$.t("Add {0} To Watchlist").format(this.getSymbol(!0));this.updateActionForIntradayOnly(c.sessionBreaks);this.updateActionForIntradayOnly(c.extendedHours)};Q7.prototype.actions=function(){this._actions||this._setActions();return this._actions};
|
|
Q7.prototype._setActions=function(){var a=this;if(!this._readOnly)for(var b=[new Action({text:$.t("Eraser"),callbackContext:"eraser"}),new ActionSeparator,new Action({text:$.t("Trend Line"),callbackContext:"LineToolTrendLine"}),new Action({text:$.t("Horizontal Line"),callbackContext:"LineToolHorzLine"}),new Action({text:$.t("Vertical Line"),callbackContext:"LineToolVertLine"}),new Action({text:$.t("Arrow"),callbackContext:"LineToolArrow"}),new Action({text:$.t("Ray"),callbackContext:"LineToolRay"}),
|
|
new Action({text:$.t("Extended"),callbackContext:"LineToolExtended"}),new Action({text:$.t("Parallel Channel"),callbackContext:"LineToolParallelChannel"}),new ActionSeparator,new Action({text:$.t("Pitchfork"),callbackContext:"LineToolPitchfork"}),new Action({text:$.t("Schiff Pitchfork"),callbackContext:"LineToolSchiffPitchfork"}),new Action({text:$.t("Pitchfan"),callbackContext:"LineToolPitchfan"}),new Action({text:$.t("Gann Square"),callbackContext:"LineToolGannSquare"}),new Action({text:$.t("Gann Fan"),
|
|
callbackContext:"LineToolGannFan"}),new Action({text:$.t("Fib Retracement"),callbackContext:"LineToolFibRetracement"}),new Action({text:$.t("Trend-Based Fib Extension"),callbackContext:"LineToolTrendBasedFibExtension"}),new Action({text:$.t("Fib Speed Resistance Fan"),callbackContext:"LineToolFibSpeedResistanceFan"}),new Action({text:$.t("Fib Time Zone"),callbackContext:"LineToolFibTimeZone"}),new Action({text:$.t("Circle Lines"),callbackContext:"LineToolCircleLines"}),new Action({text:$.t("Fib Circles"),
|
|
callbackContext:"LineToolFibCircles"}),new Action({text:$.t("Fib Speed Resistance Arcs"),callbackContext:"LineToolFibSpeedResistanceArcs"}),new ActionSeparator,new Action({text:$.t("Rectangle"),callbackContext:"LineToolRectangle"}),new Action({text:$.t("Ellipse"),callbackContext:"LineToolEllipse"}),new Action({text:$.t("Triangle"),callbackContext:"LineToolTriangle"}),new Action({text:$.t("Polyline"),callbackContext:"LineToolPolyline"}),new Action({text:$.t("Arc"),callbackContext:"LineToolArc"}),new ActionSeparator,
|
|
new Action({text:$.t("Text"),callbackContext:"LineToolText"}),new Action({text:$.t("Anchored Text"),callbackContext:"LineToolTextAbsolute"}),new Action({text:$.t("Balloon"),callbackContext:"LineToolBalloon"}),new Action({text:$.t("Price Label"),callbackContext:"LineToolPriceLabel"}),new ActionSeparator,new Action({text:$.t("Elliott Wave Subminuette"),callbackContext:"LineToolElliottSubminuette"}),new Action({text:$.t("Elliott Wave Minor"),callbackContext:"LineToolElliottMinor"}),new Action({text:$.t("Elliott Wave Circle"),
|
|
callbackContext:"LineToolElliottCircle"}),new Action({text:$.t("Elliott Minor Retracement"),callbackContext:"LineToolElliottMinorRetr"}),new Action({text:$.t("Elliott Major Retracement"),callbackContext:"LineToolElliottMajorRetr"}),new ActionSeparator,new Action({text:$.t("Brush"),callbackContext:"LineToolBrush"}),new ActionSeparator,new Action({text:$.t("Forecast"),callbackContext:"LineToolPrediction"})],a=this,c=0;c<b.length;c++)b[c].callbacks().subscribe(null,function(a){TradingView.drawingState.tool.setValue(a.callbackContext())});
|
|
c=new Action({text:$.t("Reset Chart")});c.callbacks().subscribe(this,this.GUIResetScales);var d=new Action({text:$.t("Undo"),shortcut:"ctrl+z"});d.callbacks().subscribe(null,function(){TradingView.trackEvent("GUI","Undo");Q77.undo()});d.disable();var e=new Action({text:$.t("Redo"),shortcut:"ctrl+y"});e.callbacks().subscribe(null,function(){TradingView.trackEvent("GUI","Redo");Q77.redo()});e.disable();Q77.undoStack().onChange().subscribe(this,
|
|
this.updateUndoRedo);Q77.redoStack().onChange().subscribe(this,this.updateUndoRedo);var f=new Action({text:$.t("Color Theme")}),g=new Action({text:$.t("TimeZone")}),h=new Action({text:$.t("Change Symbol...")});TVSettings.setValue("symboledit.dialog_last_entry","");h.callbacks().subscribe(this,function(){Q69.showDialog({callback:this.setSymbol.bind(this)})});var k=new Action({text:$.t("Change Interval...")});k.callbacks().subscribe(this,function(){(new ChangeIntervalDialog({callback:function(a){Q45.interval.setValue(a)}})).show()});
|
|
var l=new Action({text:$.t("Add To Watchlist")});l.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 m=new Action({text:$.t("Study Template")}),q=new Action({shortcut:"ctrl+alt+q",text:$.t("Reset Scale")});q.callbacks().subscribe(null,function(b){a.model().resetTimeScale()});var b=new Action({text:$.t("Insert Drawing Tool"),
|
|
subActions:b}),n=new Action({text:$.t("Remove All Indicators")}),t=new Action({text:$.t("Remove All Drawing Tools")}),u=new Action({text:$.t("Insert Indicator...")}),z=new Action({text:$.t("Script Editor...")}),s=new Action({text:$.t("Compare or Add Symbol...")}),A=new Action({text:$.t("Compare...")}),B=new Action({text:$.t("Objects Tree...")}),w=new Action({text:$.t("Properties..."),callback:function(b,c){a.showChartProperties()}}),v=new Action({text:$.t("Scales Properties...")}),C=new Action({text:$.t("Timezone/Sessions Properties...")}),
|
|
G=new Action({text:$.t("Lock/Unlock")});G.callbacks().subscribe(this,Q7.prototype.toggleLockSelectedObject);var I=new Action({text:$.t("Hide")});I.callbacks().subscribe(this,Q7.prototype.hideSelectedObject);var E=new Action({text:$.t("Format...")});E.callbacks().subscribe(this,Q7.prototype.editSelectedObject);var K=new Action({text:$.t("Source Code...")});K.callbacks().subscribe(this,this.openSelectedObjectSource);var D=new Action({text:$.t("Show Left Axis"),
|
|
checkable:!0});D.binder=new Z13(D,this.Z1.scalesProperties.showLeftScale,this.model(),"Show Left Scale");var F=new Action({text:$.t("Show Right Axis"),checkable:!0});F.binder=new Z13(F,this.Z1.scalesProperties.showRightScale,this.model(),"Show Right Scale");this.Z1.scalesProperties.showLeftScale.listeners().subscribe(this,Q7.prototype._updateScalesActions);this.Z1.scalesProperties.showRightScale.listeners().subscribe(this,
|
|
Q7.prototype._updateScalesActions);var P=new Action({text:$.t("Scale Price Chart Only"),checkable:!0});P.binder=new Z13(P,this.Z1.scalesProperties.scaleSeriesOnly,this.model(),$.t("Scale Price Chart Only"));var r=this.model().model();this.Z1.scalesProperties.scaleSeriesOnly.listeners().subscribe(null,function(){r.recalculateAllPanes();r.Z19(new Q22(Q22.FULL_UPDATE))});var R=new Action({text:$.t("Magnet Mode"),
|
|
checkable:!0});R.binder=new Z13(R,TradingView.drawingState.properties().magnet,this.model(),"Magnet");var M=new Action({text:$.t("Stay In Drawing Mode"),checkable:!0});M.binder=new Z13(M,TradingView.drawingState.properties().stayInDrawingMode,this.model(),"Stay In Drawing Mode");var L=new Action({text:$.t("Lock All Drawing Tools"),checkable:!0});L.binder=new Z13(L,TradingView.drawingState.lockDrawings(),this.model(),"Lock drawings",function(){TradingView.drawingState.lockDrawings().setValue(this.binder.value())}.bind(L));
|
|
var J=new Action({text:$.t("Hide All Drawing Tools"),checkable:!0});J.binder=new Z13(J,TradingView.drawingState.hideAllDrawings(),this.model(),"Hide All Drawing Tools",function(){TradingView.drawingState.hideAllDrawings().setValue(this.binder.value())}.bind(J));var N=new Action({text:$.t("Extended Hours"),checkable:!0});N.binder=new Z13(N,this.model().mainSeries().properties().extendedHours,this.model(),"Change Extended Hours");var T=new Action({text:$.t("Show Countdown"),checkable:!0,
|
|
checked:!1});T.binder=new Z13(T,this.model().mainSeries().properties().showCountdown,this.model(),"Show Countdown");this._actions={chartProperties:w,timeScaleReset:q,chartReset:c,compareOrAdd:s,compare:A,scalesProperties:v,tmzProperties:C,paneObjectTree:B,insertIndicator:u,insertDrawingTool:b,applyColorTheme:f,applyStudyTemplate:m,symbolSearch:h,changeInterval:k,addToWatchlist:l,seriesHide:I,studyHide:I,lineToggleLock:G,lineHide:I,showLeftAxis:D,showRightAxis:F,scaleSeriesOnly:P,magnetAction:R,
|
|
stayInDrawingModeAction:M,lockDrawingsAction:L,hideAllDrawingsAction:J,applyTimeZone:g,extendedHours:N,showCountdown:T,undo:d,redo:e,viewSourceCode:K};D76.enabled("charting_library")||(this._actions.scriptEditor=z);this.createSessionBreaksActions();this.readOnly()?(this._actions.paneResetAction=new Action({text:$.t("Reset")}),this._actions.paneLoadNewBarsAction=new Action({text:$.t("Load New Bars")}),this._actions.paneMakeItMineAction=new Action({text:this._containsData?$.t("Make It Mine"):
|
|
$.t("Copy")}),this._actions.paneFullScreenAction=new Action({text:$.t("Full Screen")}),this._actions.paneResetAction.callbacks().subscribe(this,function(){resetScales()}),this._actions.paneLoadNewBarsAction.callbacks().subscribe(this,function(){requestData()}),this._actions.paneMakeItMineAction.callbacks().subscribe(this,function(a){return a._containsData?function(){submitChartGoToRealTimeForm()}:function(){open("/e/?clone="+a.metaInfo().uid,"_blank")}}(this)),this._actions.paneFullScreenAction.callbacks().subscribe(this,
|
|
function(a){if(a._containsData)return function(){toggleFullscreen()};var b=new TradingView.FullscreenWidget;return function(){b.startFullscreen()}}(this))):(c=new Action({text:$.t("Remove"),shortcut:"del"}),c.callbacks().subscribe(this,function(){var a;this.Z4&&(a=this.Z4.activeChartWidget.value());a||(a=this);a.removeSelectedSource()}),this._actions.insertDrawingTool=b,this._actions.paneRemoveAllStudies=n,this._actions.paneRemoveAllDrawingTools=t,this._actions.seriesRemove=
|
|
c,this._actions.studyRemove=c,this._actions.lineRemove=c,this._actions.format=E,this._actions.lockDrawingsAction=L,this._actions.hideAllDrawingsAction=J,this._actions.paneRemoveAllStudies.callbacks().subscribe(this,Q7.prototype.removeAllStudies),this._actions.paneRemoveAllDrawingTools.callbacks().subscribe(this,Q7.prototype.removeAllDrawingTools));this._actions.paneObjectTree.callbacks().subscribe(this,Q7.prototype.showSourceProperties);
|
|
this._actions.chartProperties.callbacks().subscribe(this,Q7.prototype.showChartProperties);this._actions.insertIndicator.callbacks().subscribe(this,Q7.prototype.showIndicators);this._actions.scriptEditor&&this._actions.scriptEditor.callbacks().subscribe(this,Q7.prototype.showScriptEditor);this._actions.compareOrAdd.callbacks().subscribe(this,Q7.prototype.showCompareOrAdd);this._actions.compare.callbacks().subscribe(this,
|
|
Q7.prototype.showCompareOrAdd);this._actions.scalesProperties.callbacks().subscribe(this,Q7.prototype.showScalesProperties);this._actions.tmzProperties.callbacks().subscribe(this,Q7.prototype.showTimezoneProperties);this._updateScalesActions()};
|
|
Q7.prototype._updateScalesActions=function(){if(this._actions){this._actions.showRightAxis.setEnabled(this.Z1.scalesProperties.showLeftScale.value());this._actions.showLeftAxis.setEnabled(this.Z1.scalesProperties.showRightScale.value());for(var a=0;a<this._paneWidgets.length;a++)this._paneWidgets[a].updateScalesVisibility();this._timeAxisWidget.updatePriceScalesVisibility();this._update(new Q22(Q22.FULL_UPDATE))}};
|
|
Q7.prototype.removeAllStudies=function(){this.D99.removeAllStudies()};Q7.prototype.removeAllDrawingTools=function(){this.D99.removeAllDrawingTools()};Q7.prototype.model=function(){return this.D99};Q7.prototype.connect=function(){this._handler=function(a){this._onData(a)}.bind(this);this._chartSession.connect(this._handler)};
|
|
Q7.prototype.finishInitWithoutConnect=function(){this._chartSession.disable();this._init();this.chartWidgetInitialized.fire()};Q7.prototype.update=function(){if(this.D99){for(var a=0;a<this._paneWidgets.length;a++)this._paneWidgets[a].update();this._timeAxisWidget.update()}};
|
|
Q7.prototype.paint=function(a){a||(a=new Q22(Q22.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()};
|
|
Q7.prototype._makeDefaultGui=function(){this._makeChartWidget();this._makeLoadingScreen();this._makeMasterTable();this._addPaneWidget(new Q53(this,null,this._onWidget));this._makeTimeAxisWidget();this._adjustSize();this._updateScalesActions();$("*",this._jqMainTable).selectable(!1);this.update();this.paint()};Q7.prototype.widget=function(){return this._jqMainDiv};
|
|
Q7.prototype.restoreState=function(a,b){this._adjustSize();this.D99.restoreState(this._content,b);this._setActions()};Q7.prototype.redrawPanes=function(a){$.each(this._paneWidgets,function(a){this.paint()});this._redrawPanes.fire()};
|
|
Q7.prototype.adaptOnChartLogo=function(a){D76.enabled("adapt_onchart_logo_background")&&($(".onchart-custom-logo .wrapper .inner").css("background-color",generateColor(a,50)),$(".onchart-tv-logo .wrapper .inner").css("background-color",generateColor(a,20)))};
|
|
Q7.prototype.setBackgroundColor=function(a){this.adaptOnChartLogo(a.value());this.scaleBackgroundColor=a.value();$.each(this._paneWidgets,function(a){this.paint();this.setCursorForTool()});this.update();this.paint()};Q7.prototype.setScaleLineColor=function(a){this.scaleLineColor=a.value();$.each(this._paneSeparators,function(){this.update()});this.update();this.paint()};
|
|
Q7.prototype.setScaleTextColor=function(a){this.scaleTextColor=a.value();this.update();this.paint()};
|
|
Q7.prototype._update=function(a){if(!a||a.fullInvalidation()===Q22.FULL_UPDATE){if(this.D99){var b=!1;if(this._paneWidgets.length!==this.D99.panes().size())b=!0;else for(var c=this.D99.panes(),d=this._paneWidgets.length;d--;)if(this._paneWidgets[d].state()!==c.item(d)){b=!0;break}b&&this._updateGui()}this._adjustSize();this._timeAxisWidget.update();for(d=0;d<this._paneWidgets.length;d++)this._paneWidgets[d]._state=this.D99.panes().item(d),this._paneWidgets[d].statusWidget().updateLayout();
|
|
this._dataWindowWidget&&this._dataWindowWidget.updateAll()}else if(a.fullInvalidation()===Q22.LIGHT_UPDATE){this._timeAxisWidget.update();this.paint(new Q22(Q22.UPDATE_CURSOR_ONLY));for(d=0;d<this._paneWidgets.length;d++)this._paneWidgets[d].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}else if(a.fullInvalidation()===Q22.UPDATE_CURSOR_ONLY){for(d=0;d<this._paneWidgets.length;d++)this._paneWidgets[d].statusWidget().update();
|
|
this._dataWindowWidget&&this._dataWindowWidget.update()}this.paint(a)};
|
|
Q7.prototype._makeDefaultModel=function(){function a(){return makeDefaultChartModel(c._chartSession,function(a){if(!(a instanceof Q22))throw new "Invalid mask";c._invalidateMask?c._invalidateMask.merge(a):c._invalidateMask=a;c._draw_planned||(c._draw_planned=!0,requestAnimationFrame(b))},c.Z1,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");D76.enabled("lean_chart_load")?this.D99=this.D99||a():this.D99=a();D76.enabled("create_volume_indicator_by_default")&&this._options.addVolume&&!this._content&&(D76.enabled("charting_library")?this.D99.mainSeries().onCompleted():this.D99.mainSeries().onSymbolResolved()).subscribe(this,
|
|
function(){var a=this.D99.model().mainSeries().symbolInfo();a&&(a=!a.hasOwnProperty("has_no_volume")||!a.has_no_volume,!this.containsVolume()&&a?this.insertStudy("Volume@tv-basicstudies",!1):!a&&this.containsVolume()&&(a=this.model().Z18().find(function(a){return a instanceof TradingView.Study&&"Volume"==a.metaInfo().shortId}),this.D99.model().removeSource(a)))},!D76.enabled("charting_library"));this._content?this.restoreState(this._content,this._containsData):this._setActions();
|
|
this.D99.onTagsChanged().subscribe(this,Q7.prototype.onModelTagsChanged);this._updateGui();this._modelCreated.fire(this.D99);this._tagsChanged.fire();c=this;setTimeout(function(){for(var a=0;a<c._paneWidgets.length;a++)c._paneWidgets[a].adjustLegendPosition()},500);var e=this.D99.mainSeries();this.D99.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||Q83.showGoProDialog({feature:"kagiRenko"})}),e.intradaySpreadNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");c._options.muteSessionErrors||Q83.showGoProDialog({feature:"intradaySpread"})}),e.customIntervalNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");c._options.muteSessionErrors||Q83.showGoProDialog({feature:"customIntervals"})}),
|
|
e.intradayExchangeNotPermitted.subscribe(null,function(){e.properties().interval.setValue("D");if(!c._options.muteSessionErrors){var a=e.symbolInfo().listed_exchange;TVChartApi.prototype.supportedExchangesList().forEach(function(b){b.value==a&&(a=b.name)});Q83.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||Q83.showIntervalMismatchDialog()}),e.requestingResolutionWhenNotSupported.subscribe(null,function(a){e.properties().interval.setValue(a)}),c._options.muteSessionErrors||e.onExtendedHoursChanged().subscribe(null,function(){e.onExtendedHoursNotPermitted().subscribe(null,function(a){Q83.showGoProDialog({feature:"extendedHours"})})},!0))};
|
|
Q7.prototype._updateGui=function(){this.D99&&(this._makePaneWidgetsAndSeparators(),this._makeTimeAxisWidget(),$("*",this._jqMainTable).selectable(!1),this._adjustSize())};Q7.prototype._dateRangeResolutions=function(){return Z15.availableTimeFrames(this.D99.mainSeries().symbolInfo(),this.D99.mainSeries().status())||[]};
|
|
Q7.prototype._makeChartWidget=function(){this._jqMainDiv=$(document.createElement("div"));this._jqMainDiv.appendTo(this._jqParent);this._jqMainDiv.addClass("chart-widget");TradingView.setAbsoluteRect(this._jqMainDiv,this._rect);this._withDateRanges&&(D76.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,
|
|
Z2:this}));if(this._options.controlBar||D76.enabled("control_bar"))this._controlBarNavigation=new Q9(this,this._jqMainDiv,!0);this._containsData||this.createIndicatorImage()};Q7.prototype._makeLoadingScreen=function(){D76.enabled("lean_chart_load")?this.screen||(this.screen=new Q7.LoadingScreen(this,this._jqParent)):this.screen=new Q7.LoadingScreen(this,this._jqMainDiv)};
|
|
Q7.prototype.setSymbol=function(a){if(this.D99){var b=this.D99.mainSeries();if(!b.symbolSameAsCurrent(a)||D76.enabled("same_data_requery"))this.D99.setSelectedSource(null),this.D99.setScreenChartProperty(b.properties().symbol,a,this,"Change Symbol",D76.enabled("same_data_requery"))}else this.Z1.mainSeriesProperties.merge({symbol:a})};
|
|
Q7.prototype.getSymbol=function(a){var b;return(b=this.D99?this.D99.mainSeries().properties():this.Z1.mainSeriesProperties)?a&&b.shortName&&b.shortName.value()?b.shortName.value():b.symbol.value():""};
|
|
Q7.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)};
|
|
Q7.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()}})};Q7.LoadingScreen.prototype.show=function(){this._cw._inLoadingState=!0;this._showed||this._cw.isDetached||(this._showed=!0,this._show());return $.Deferred().resolve()};
|
|
Q7.LoadingScreen.prototype._show=function(){var a=this._cw.properties().paneProperties.background.value();this.$shield.css("background",a);this.$element.addClass("fade")};Q7.LoadingScreen.prototype.hide=function(){delete this._cw._inLoadingState;this._showed&&this._hide()};Q7.LoadingScreen.prototype._hide=function(){this._showed=!1;this.$element.removeClass("fade")};Q7.LoadingScreen.prototype.$canvas=null;
|
|
Q7.LoadingScreen.prototype.context=null;Q7.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")};Q7.prototype._addPaneWidget=function(a){a.jqRow.appendTo(this._jqMainTable);this._paneWidgets.push(a)};
|
|
Q7.prototype._makePaneWidgetsAndSeparators=function(){for(;this._paneWidgets.length;)this._paneWidgets.pop().destroy();this._jqMainTable.find("*").remove();this._jqMainDiv.find("table.pane-legend, div.pane-controls, input.symbol-edit").find("*").andSelf().remove();for(var a=this.D99.panes().size(),b=0;b<a;++b)this._addPaneWidget(new Q53(this,this.model().panes().item(b),this._onWidget));a-=1;this._paneSeparators=[];for(b=0;b<a;++b){var c=new Q52(this,
|
|
b,b+1);c.jqRow.insertAfter(this._paneWidgets[b].jqRow);this._paneSeparators.push(c)}};Q7.prototype._makeTimeAxisWidget=function(){this._timeAxisWidget=new Q73(this,this._onWidget);this._timeAxisWidget.jqRow.appendTo(this._jqMainTable)};
|
|
Q7.prototype.insertStudyOrShowDialog=function(a){if(this.isSymbolicStudy(a)){var b=defaults("study_"+a.id).description;Q83.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,Q83.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))};Q7.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};
|
|
Q7.prototype.isSymbolicStudy=function(a){switch(a.id){case "Overlay@tv-basicstudies":case "CorrelationCoefficient@tv-basicstudies":return!0;default:return!1}};Q7.prototype.isPointsBasedStudy=function(a){return TradingView.Study.isPointsBasedStudy(a.id)};
|
|
Q7.prototype.insertStudy=function(a,b,c,d){a=StudyMetaInfo.findStudyMetaInfo(this._studiesMetaData,a);a=StudyMetaInfo.replaceWithFullStudyMetaInfo(this._studiesMetaData,a);d=d?{inputs:d}:void 0;b?this.D99.insertStudy(a,d,c):this.D99.model().insertStudy(a,d,c)};
|
|
Q7.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=new Q61(this._jqMainDiv.width(),this._jqMainDiv.height()),e=d.w-a-b,f=this._paneSeparators.length,g=Q52.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.D99&&(this._state=l.D99.panes().item(c));c=Math.max(Math.round(this.stretchFactor()*k),2);this.setPriceAxisSize(Q54.LHS,new Q61(a,c));this.setPriceAxisSize(Q54.RHS,new Q61(b,c));this.setSize(new Q61(e,c));l.D99&&this.state()&&l.D99.setPaneHeight(this.state(),c)});this._timeAxisWidget.setSize(new Q61(e,h),new Q61(a,h),new Q61(b,
|
|
h));this.D99&&this.D99.setWidth(e);this.maxLhsPriceAxisWidth!==a&&(this.maxLhsPriceAxisWidth=a,this.lhsPriceAxisWidthChanged.fire(a));this.maxRhsPriceAxisWidth!==b&&(this.maxRhsPriceAxisWidth=b,this.rhsPriceAxisWidthChanged.fire(b))};
|
|
Q7.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.D99.onData(a)}};Q7.prototype._nextMetadataId=1;
|
|
function _applyLocalizationToMetadata(a){a.description_localized=$.t(a.description,{context:"study"});return a}
|
|
Q7.prototype._onConnection=function(){this._online=!0;this.D99?(this.D99.restart(),this._updateGui(),this.update(),this.paint(),this._connected.fire()):(D76.enabled("charting_library")?this._chartSession.requestMetadata("metadata_"+Q7._nextMetadataId,function(a){a=a.params[1];for(var b=0;b<a.length;++b)StudyMetaInfo.addStudyMetaInfo(this._studiesMetaData,_applyLocalizationToMetadata(a[b]));this._init();this.chartWidgetInitialized.fire()}.bind(this)):
|
|
this._chartSession.requestMetadata("metadata_"+Q7._nextMetadataId,function(a){this._onStudiesMetadata(a)}.bind(this)),Q7._nextMetadataId++)};Q7.prototype._onDisconnect=function(){this.D99&&this.D99.disconnect();this._online=!1;this.update();this.paint();this._disconnected.fire()};Q7.prototype.studiesMetaData=function(){return this.D99.studiesMetaData()};
|
|
Q7.prototype._onConnectionError=function(a){this._disconnected.fire()};Q7.prototype.getTimeScale=function(){return this._timeAxisWidget};Q7.prototype.setSeriesStyle=function(a,b){this.D99.setProperty(a.properties().style,b)};Q7.prototype.showSourceProperties=function(a){(new ObjectTreeDialog({Z2:this},this.D99)).show()};
|
|
Q7.prototype.showChartProperties=function(a){return(new EditObjectDialog(this.D99.mainSeries(),this.D99)).show()};Q7.prototype.showScriptEditor=function(){window.scriptEditor.show()};Q7.prototype.showCompareOrAdd=function(){(new CompareDialog(this.Z4)).show()};Q7.prototype.showIndicators=function(){studyMarket.isVisible()?studyMarket.hide():studyMarket.show()};
|
|
Q7.prototype.showScalesProperties=function(a){return(new EditObjectDialog(this.D99.mainSeries(),this.D99)).show({selectScales:!0})};Q7.prototype.showTimezoneProperties=function(){return(new EditObjectDialog(this.D99.mainSeries(),this.D99)).show({selectTmz:!0})};
|
|
Q7.prototype.removeSelectedSource=function(){var a=this.D99.selectedSource();!a||a===this.D99.mainSeries()||a===this.D99.lineBeingCreated()||a instanceof D95||a instanceof TradingView.ESDStudyBase||this.D99.removeSelectedSource()};Q7.prototype.hideSelectedObject=function(){var a=this.D99.selectedSource();a&&this.D99.setProperty(a.properties().visible,!1,"Hide "+a.title())};
|
|
Q7.prototype.toggleLockSelectedObject=function(){var a=this.D99.selectedSource();if(a){var b=a.properties().frozen.value();this.D99.setProperty(a.properties().frozen,!b,(b?"Unlock":"Lock")+" "+a.title())}};Q7.prototype.editSelectedObject=function(a){if(a=this.D99.selectedSource())return(new EditObjectDialog(a,this.D99)).show()};
|
|
Q7.prototype.openSelectedObjectSource=function(a){(a=this.D99.selectedSource())&&a.metaInfo&&(a=a.metaInfo())&&a.TVScriptSourceCode&&a.scriptIdPart&&"undefined"!==typeof scriptEditor&&scriptEditor.show({scriptSource:a.TVScriptSourceCode,scriptIdPart:a.scriptIdPart})};Q7.prototype.resetPriceAxisOptimalWidth=function(a){$.each(this._paneWidgets,function(){this.resetPriceAxisOptimalWidth(a)});this._redrawPanes.fire()};
|
|
Q7.prototype.adjustPriceAxisWidth=function(a){this.resetPriceAxisOptimalWidth(a);this._adjustSize()};Q7.prototype.setPriceAxisVisible=function(a,b){$.each(this._paneWidgets,function(){this.setPriceAxisVisible(a,b)});this._timeAxisWidget.setStubVisible(a,b);this._adjustSize();this._redrawPanes.fire()};Q7.prototype.setTimeAxisVisible=function(a){this._timeAxisWidget.setVisible(a);this._adjustSize()};
|
|
Q7.prototype.isTextTool=function(a){switch(a){case "LineToolBalloon":case "LineToolText":case "LineToolTextAbsolute":case "LineToolCallout":case "LineToolNote":case "LineToolNoteAbsolute":return!0}return!1};Q7.prototype.tags=function(){return this.D99?this.D99.calculateDefaultTags():[]};Q7.prototype.state=function(a){return this.D99.state(a)};Q7.prototype.asyncState=function(a){return this.D99.asyncState(a)};
|
|
Q7.prototype.metaInfo=function(){var a=this._metaInfo;this.D99&&(a.systemTags=this.D99.calculateDefaultTags());return a};
|
|
Q7.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().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};
|
|
Q7.prototype.images=function(){TradingView.printing=!0;var a=this.D99.selectedSource();this.D99.setSelectedSource(null);for(var b=[],c=0;c<this._paneWidgets.length;c++){var d=this._paneWidgets[c];d.paint(Q22.LIGHT_UPDATE,this._onWidget);var e=d.image(this._onWidget);e.containsMainSeries=this._paneWidgets[c].containsMainSeries();e.studies=[];for(var d=d.state().Z18(),f=0;f<d.size();f++){var g=d.item(f);g instanceof TradingView.Study?g.properties().visible.value()&&
|
|
g.statusView()&&e.studies.push(g.statusView().text()):g instanceof TradingView.Series&&(e.mainSeriesText=g.statusView().text())}b.push(e);c<this._paneWidgets.length-1&&b.push(this._paneSeparators[c].image())}this._timeAxisWidget.paint(Q22.LIGHT_UPDATE);c=this._timeAxisWidget.image();TradingView.printing=!1;this.D99.setSelectedSource(a);this.D99.Z19(new Q22(Q22.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}};
|
|
Q7.prototype.mainSeriesQuotesAndMetainfo=function(){var a,b,c,d=this.D99.mainSeries();if(d){var e=function(a){return null==a?"":d.formatter().format(a)+""};a={resoluton:d.interval(),symbol:d.symbol()};var f=d.symbolInfo();f&&(a.symbol=f.full_name,a.description=f.description,a.exchange=f.exchange);(f=d.bars().last())&&(b=f.value.slice(1,5).map(e));d.quoteData&&(c={change:e(d.quoteData.change),changePercent:null==d.quoteData.change_percent?"":d.quoteData.change_percent+"",last:e(d.quoteData.last_price)})}return{meta:a,
|
|
ohlc:b,quotes:c}};Q7.prototype.onTagsChanged=function(){return this._tagsChanged};Q7.prototype.onModelTagsChanged=function(){this._tagsChanged.fire()};Q7.prototype.destroy=function(){$(window).unbind("resize",this._resizeHandler);this.D99.model().destroy()};Q7.prototype.title=function(){return $.t("Chart Properties")};
|
|
Q7.prototype.symbolProperty=function(){return this.D99.mainSeries().properties().shortName?this.D99.mainSeries().properties().shortName:this.D99.mainSeries().properties().symbol};
|
|
Q7.prototype.loadContent=function(a,b){this.screen.show();var c=this;setTimeout(function(){for(var d=c.D99.model().Z18(),e=0;e<d.size();e++){var f=d.item(e);f!=c.D99.mainSeries()&&c.D99.model().removeSource(f,!0)}c._jqMainDiv.remove();Z15.purgeCache();c.D99.mainSeries().purgeSymbolInfo();c._setContent(a);d=a.panes[0].sources[0].state;b&&(Z5.metaInfo.id.setValue(b.uid),Z5.metaInfo.uid.setValue(b.uid),Z5.metaInfo.name.setValue(b.name));
|
|
c.Z1.mainSeriesProperties.merge({visible:!0,symbol:d.symbol,timeframe:"",onWidget:c._onWidget,interval:d.interval||"D",style:d.style});c._init();Q45.interval.setValue(d.interval);Q77.clearStack();c._seriesControlWidget.updateUI()},10)};
|
|
Q7.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.logNormal("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};Q7.prototype.updateUndoRedo=function(){Q77.undoStack().isEmpty()?this.actions().undo.setEnabled(!1):this.actions().undo.setEnabled(!0);Q77.redoStack().isEmpty()?this.actions().redo.setEnabled(!1):this.actions().redo.setEnabled(!0)};
|
|
Q7.prototype.createSessionBreaksActions=function(a){var b,c=this,d=function(){b=new Action({text:$.t("Session Breaks"),checkable:!0});b.binder=new Z13(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()})};
|
|
Q7.prototype.updateActionForIntradayOnly=function(a){!a||!a instanceof Action||a.setEnabled(!!this.model().mainSeries().isIntradayInterval())};Q7.prototype.withModel=function(a,b){this.model()?b.call(a):this.modelCreated().subscribe(a,b,!0)};Q7.prototype.containsVolume=function(){return!!this.model().Z18().find(function(a){return a instanceof TradingView.Study&&"Volume"==a.metaInfo().shortId})};
|
|
Q7.prototype.containsStudy=function(a){return this.D99?!!this.D99.Z18().find(function(b){if(!(b instanceof TradingView.Study))return!1;b=b.metaInfo();return b.id===a||b.fullId===a}):!1};Q7.prototype.containsSessions=function(){return!!this.model().Z18().find(function(a){return a instanceof TradingView.Study&&"Sessions"==a.metaInfo().shortId})};Q7.prototype.isSmall=function(a){return this.constructor.isSmall(this._jqParent)};
|
|
Q7.isSmall=function(a){return 550>a.width()||300>a.height()};Q7.prototype.onWidget=function(){return this._onWidget};Q7.prototype.onCmeWidget=function(){return this._onCmeWidget};Q7.prototype.resize=function(){this._resizeHandler&&this._resizeHandler()};Q7.prototype.chartSession=function(){return this._chartSession};Q7.prototype.maxLhsPriceAxisWidth=0;
|
|
Q7.prototype.maxRhsPriceAxisWidth=0;Q7.prototype.GUIResetScales=function(){TradingView.trackEvent("GUI","Reset Scales");this.model()&&(this._containsData?this.model().chartModel().restoreAxisState(this._content):this._controlBarNavigation&&this._controlBarNavigation.resetButtons(),this.model().resetScales())};Q7.prototype.onLineCancelled=function(){TradingView.drawingState.resetToCursor()};
|
|
Q7.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("<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 access real-time data from exchanges.</p>",
|
|
"bottom","double-width");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.D99.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()};
|
|
Q7.prototype.updateIndicatorImage=function(){var a=this.indicatorImage;if(this.indicatorImage){var b=this.D99;if(b){var b=b.mainSeries(),c=b.status(),d=this._statusDetails(),e=null,e=d.hasOwnProperty(c)?d[c]:d.defaults,c=e.hasOwnProperty("showBatsWarn")?e.showBatsWarn:!0,d=(d=b.symbolInfo())&&d.full_name,c=!!(c&&d&&Q68.hasBatsSymbols(d));a.find(".bats-warning").toggleClass("warn-bats",c);a.attr("title",e.hasOwnProperty("title")?e.title:"");this._updateDataAndMarketStatus(b.marketStatus.value(),
|
|
b.status())}}};
|
|
Q7.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};Q7.prototype._updateDataAndMarketStatus=function(a,b){var c=this._resultingStatusRecord(a,b);this.indicatorText.removeClass().addClass("series-status-text "+c.className);this.indicatorText.find(".text").html(c.text)};
|
|
Q7.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]};Q7.prototype.updateIndicatorImagePosition=function(){var a=this.indicatorImage;this.indicatorImage&&a.css("marginRight",this.maxRhsPriceAxisWidth)};Q8=function(a){function b(){N&&N(J);var a=w||{};w={width:J.width(),height:J.height()};var b=!1;a.height===w.height&&a.width===w.width&&v||(b=!0);if(b)if(P)c(B);else for(a=0;a<v.count;a++)c(a)}function c(a){var b=A[a];if(b){var c=P?Q8.LayoutTemplates.s.sizer(0,w,t,u):v.sizer(a,w,t,u);A[a].wrap.css({width:c.width||0,height:c.height||0,top:c.top||0,left:c.left||0});b.metrics&&b.metrics.width===c.width&&b.metrics.height===c.height||(b.metrics=
|
|
c,b.Z2&&b.Z2.resize())}}function d(a){a=$.extend({Z5:n},a||{});var b,d=$(document.createElement("div")).addClass("chart-container").appendTo(J).css("position","absolute");d.on("mousedown touchstart",function(){z.setValue(b)});var e=A.length,h={wrap:d};A.push(h);c(e);a.jqParent=d;h.Z2=b=new Q7(a);n.firstWidgetInitialized||b.chartWidgetInitialized.subscribe(null,function(){try{JsBridge.sendEvent("chart_widget_initialized")}catch(a){}n.firstWidgetInitialized=
|
|
!0},!0);a.containsData?b.finishInitWithoutConnect():b.connect();f();g();return b}function e(a,b){C=a;P=b;r.setValue(P);v=Q8.LayoutTemplates[a];var e=v.count;w={width:J.width(),height:J.height()};for(var g=0;g<e||g<A.length;g++)(b?B===g:g<e)?(A[g]?(J.append(A[g].wrap),A[g].Z2.isDetached=!1):d($.extend({},R,G.shift()||(z.value()?{content:z.value().state()}:null)||{})),A[g].wrap.toggleClass("multiple",1<e),c(g)):A[g]&&(A[g].Z2.isDetached=!0,A[g].wrap.detach());
|
|
f()}function f(){var a=Math.min(v.count,A.length)-1;if(0>a)z.deleteValue();else{var b=B;0>b&&(b=0);b>a&&(b=a);z.setValue(A[b].Z2)}}function g(){for(var a=A.length;a--;){var b=a===B;A[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){T.setValue(a.value())}function l(a){O.setValue(a)}function m(a){for(var b=
|
|
!1,c=0;c<A.length;c++){var d=A[c].Z2;if(d.model().mainSeries().properties().symbol.value()!==a||D76.enabled("same_data_requery"))b||(Q77.beginUndoMacro("Change Symbol"),b=!0),d.setSymbol(a)}b&&Q77.endUndoMacro()}function q(a){if("s"===a||window.user&&user.is_pro||R.containsData||s)return a;Q83.showGoProDialog({feature:"multipleCharts"});return"s"}var n=this,t=2,u=0,z=new WatchedValue,s=!1,A=[],B=0,w=null,v=null,C="s",G=[],I=new WatchedValue(!1),
|
|
E=new WatchedValue(!1),K=new WatchedValue(TVSettings.getBool("chart.syncCrosshair",!0)),D=K.value();K.subscribe(function(a){D=a=!!a;TVSettings.setValue("chart.syncCrosshair",a)});var F=new WatchedValue(C),P=!1,r=new WatchedValue(P);a=a||{};"padding"in a&&(t=a.padding);"edge"in a&&(u=a.edge);var R=a.widgetOptions||{};R.readOnly&&(s=!0);var M=a.metaInfo||{},L={id:new WatchedValue(M.id),name:new WatchedValue(M.name),description:new WatchedValue(M.description),username:new WatchedValue(M.username),uid:new WatchedValue(M.uid)},
|
|
J=$(a.jqParent).eq(0),N=a.onResize;this.updateLayout=b;var T=new WatchedValue,O=new WatchedValue;T.subscribe(function(a){var b=z.value();if(b&&(b=b.model())){var c=b.mainSeries().properties().style;c.value()!==a&&b.setChartStyleProperty(c,a,"Change Series Style")}});var W=null;z.subscribe(function(a){if(a){for(var b,c=A.length;c--;)if(A[c].Z2===a){b=c;break}if(!isFinite(b))throw Error("Cannot make detached ChartWidget active");B!==b&&(B=b,g());W!==a&&(W&&(W.modelCreated().unsubscribe(null,
|
|
h),b=W.model())&&(b.mainSeries().properties().style.unsubscribe(null,k),b.model().onSelectedSourceChanged().unsubscribe(null,l),W=null),a&&((b=a.model())?h(b):a.modelCreated().subscribe(null,h),W=a))}},{callWithLast:!0});$.extend(this,{createChartWidget:d,getAll:function(){return A.map(function(a){return a.Z2})},destroy:function(){return A.forEach(function(a){a.Z2.destroy()})},layout:F,maximizeCurrentChart:r,activeChartWidget:z,activeChartStyle:T,selectedSource:O.readonly(),metaInfo:L,
|
|
state:function(a){for(var b=[],c=Q8.LayoutTemplates[C].count,d=0;d<c;d++)b.push(A[d].Z2.state(a));a={layout:C,charts:b};I.value()&&(a.symbolLock=1);E.value()&&(a.intervalLock=1);return a},asyncState:function(a){for(var b=$.Deferred(),c=[],d=Q8.LayoutTemplates[C].count,e=0;e<d;e++)c.push(A[e].Z2.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 s},lock:{symbol:I,setSymbolLockWithUndo:function(a){if(a!==I.value()){Q77.beginUndoMacro("Symbol Lock");if(a)for(var b=z.value(),c=b.getSymbol(),d=0;d<A.length;d++){var e=A[d].Z2;e!==b&&e.getSymbol()!==c&&e.setSymbol(c)}Q77.setWatchedValue(I,a,"Symbol Lock");Q77.endUndoMacro()}},interval:E,setIntervalLockWithUndo:function(a){if(a!==E.value()){Q77.beginUndoMacro("Interval Lock");
|
|
if(a)for(var b=z.value(),c=b.getResolution(),d=0;d<A.length;d++){var e=A[d].Z2;e!==b&&e.getResolution()!==c&&e.setResolution(c)}Q77.setWatchedValue(E,a,"Resolution Lock");Q77.endUndoMacro()}},crosshair:K},setSymbol:function(a){I.value()?m(a):z.value().setSymbol(a)},setResolution:function(a){if(E.value()){for(var b=!1,c=0;c<A.length;c++){var d=A[c].Z2;d.model().mainSeries().properties().interval.value()!==a&&(b||(Q77.beginUndoMacro("Change Resolution"),
|
|
b=!0),d.setResolution(a))}b&&Q77.endUndoMacro()}else z.value().setResolution(a)},updateLayout:b,images:function(a){if(a&&a.onlyActiveChart||P)return{layout:"s",hidpiRatio:window.hidpiCanvasRatio||1,charts:[z.value().images()]};a=[];for(var b=v.count,c=0;c<A.length&&c<b;c++)a.push(A[c].Z2.images());return{layout:C,hidpiRatio:window.hidpiCanvasRatio||1,charts:a}},syncCrosshair:function(a,b){if(D&&!P)for(var c=v.count,d=0;d<A.length&&d<c;d++){var e=A[d].Z2;e!==b&&
|
|
(e=e.model())&&e.model().setExternalPosition(a)}},setSymbolAll:m,clearChartMetaInfo:function(){L.id.setValue(void 0);L.uid.setValue(void 0);L.name.setValue(void 0)}});if(a=a.content){a.charts||(a={layout:"s",charts:[a]});C=q(a.layout||"s");for(K=0;K<a.charts.length;K++)G.push({content:a.charts[K]});a.symbolLock&&I.setValue(!0);a.intervalLock&&E.setValue(!0);a=null}F.setValue(C);e(C,P);G.splice(0,G.length);F.subscribe(function(a){e(a,!1)});F.hook=function(a){return a===this.value()?a:q(a)};s&&(F.writeLock=
|
|
!0);r.subscribe(function(a){a!==P&&e(C,a)});$(window).on("resize",b)};
|
|
Q8.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}}}}};function CompareWidget(a){this.Z4=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"}}
|
|
CompareWidget.prototype.addCompareSymbol=function(a,b,c){if(b=this.Z4.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");b.insertStudy(f,a)}};
|
|
CompareWidget.prototype.removeCompareSymbol=function(a){var b=this.Z4.activeChartWidget.value();if(b&&(b=b.model()))for(var c=b.Z18(),d=0;d<c.size();d++){var e=c.item(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)}}};
|
|
CompareWidget.prototype._createPredefinesList_normal=function(){var a=this;for(p in this.predefines)for(i in predefine=$('<div class="predefine-section">').appendTo(this._widget),this.predefines[p])line=$('<div class="predefine-line"></div>').appendTo(predefine),checkbox=$('<input type="checkbox" id="predefine-checkbox-'+this.symbolToId(this.predefines[p][i])+'"/>').appendTo(line),checkbox.change({symbol:this.predefines[p][i]},function(b){$(this).is(":checked")?a.addCompareSymbol(b.data.symbol):a.removeCompareSymbol(b.data.symbol)}),
|
|
$('<label for="predefine-checkbox-'+this.symbolToId(this.predefines[p][i])+'">'+i+"</label>").appendTo(line);$('<div class="clear"></div>').appendTo(this._widget)};
|
|
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=Q69.bindToInput(this.input,{callback:function(b){a.addCompareSymbol(b)},keepFocus:!0,
|
|
clearAfterAccept:!0});c.click(function(){d.acceptTypeIn()});b.appendTo(this._widget);D76.enabled("charting_library")||this._createPredefinesList_normal()};
|
|
CompareWidget.prototype.show=function(){var a=this.Z4.activeChartWidget.value();if(a&&(a=a.model()))for(p in a=a.Z18(),this.init(),this._widget.find('input[id^="predefine-checkbox"]').attr("checked",!1),this.predefines)for(i in this.predefines[p])for(var b=this._widget.find("#predefine-checkbox-"+this.symbolToId(this.predefines[p][i])),c=0;c<a.size();c++){var d=a.item(c);if(d._metaInfo&&"Compare@tv-basicstudies"===d._metaInfo.id){var e=this.predefines[p][i],d=d.properties().inputs.symbol.value();
|
|
(d===e||this.symbolAlias[d]&&this.symbolAlias[d]===e)&&b.attr("checked",!0)}}};CompareWidget.prototype.symbolToId=function(a){return a.replace(/[^a-z0-9]/gi,"_")};CompareWidget.prototype.focus=function(){Modernizr.touch||this.input.focus()};function CompareDialog(a){this.Z5=a}CompareDialog.prototype.tabChanged=function(a){0===a?this.compareTab.focus():this.addSymbolTab.focus()};
|
|
CompareDialog.prototype.show=function(){TradingView.trackEvent("GUI","Compare Add");var a=Q83.createDialog("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 CompareWidget(this.Z5);this.addSymbolTab=new AddSymbolWidget(this.Z5);this.compareTab.show();d.append(this.compareTab._widget);this.addSymbolTab.show();e.append(this.addSymbolTab._widget);this.tabs=new Q71(c,b,{saveTab:"CompareAddDialog.tab"});this.tabs.tabChanged.subscribe(this,this.tabChanged);Q83.applyHandlers(a);
|
|
Q83.positionDialog(a,this.position);return a};function AddSymbolWidget(a){this.Z4=a;this.init()}
|
|
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=Q69.bindToInput(c,{callback:function(b){var c=a.Z4.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)};
|
|
AddSymbolWidget.prototype.show=function(){this.focus();this._checkbox.attr("checked",TVSettings.getBool("showAddSymbolDialog.checkboxState",!0))};AddSymbolWidget.prototype.focus=function(){Modernizr.touch||this._input.focus()};TradingView.SYMBOL_SEARCH_MAX_LENGTH=100;Q4=function(){};Q4.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)};
|
|
Q4.prototype._createBarsGroup=function(a){var b=this.createGroup({single:!0});a._style_list.element().appendTo(b);return b};
|
|
Q4.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($("<i>")).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};
|
|
Q4.prototype._createCompareGroup=function(a,b,c){a=this.createGroup({single:!0});var d=$('<a class="button iconed toggle-caption compare apply-common-tooltip">').append($("<i>")).append($('<span class="caption">Compare</span>')).appendTo(a);this._compareButton=d;this._compareButton.on(c,function(a){a.preventDefault();a=(new CompareDialog(b)).show();d.addClass("active");a.on("destroy",function(){d.removeClass("active")})});this._compareButton.attr("title",$.t("Compare or Add Symbol"));
|
|
return a};
|
|
Q4.prototype._createIndicatorsGroup=function(a,b){var c=this.createGroup({single:!0});this._indicatorsButton=$('<a class="button iconed toggle-caption indicators'+(this._onWidget?" no-last":"")+' apply-common-tooltip">').append($("<i>")).append($('<span class="caption">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();studyMarket.isVisible()?
|
|
studyMarket.hide():studyMarket.show()});TradingView.keyboardBinder.registerListener("IndicatorsHotkey",function(a){if("47"==a.which&&$(a.target).is("body")&&!studyMarket.isVisible())return studyMarket.show(),studyMarket.selectSearchPage(),a.preventDefault(),a.stopPropagation(),!0});studyMarket.visibilityChanged.subscribe(this,function(a){this._indicatorsButton.toggleClass("active",a)});return c};
|
|
Q4.prototype.createGroup=function(a){a||(a={});var b=$("<div>").addClass("group");a.right&&b.addClass("right");a.single?b.addClass("space-single"):null;return b};Q4.prototype.bindToModel=function(){var a=this.Z3.model();a.mainSeries().properties();this.D99=a};Q4.prototype.backButton=function(){return this._backButton};
|
|
Q4.prototype.saveLoadWidget=function(){return this._saveLoad||console.warn("No save-load widget created in footer")};Q4.prototype.styleIconPosition=function(a){return"-%1px 0".replace("%1",19*~~a)};Q4.styleIconPosition=Q4.prototype.styleIconPosition;Q5=function(a){a=a||{};var b=this.Z4=a.Z5,c=this.Z3=b.activeChartWidget.value(),d=this._onWidget=c.onWidget(),e=this,f=Modernizr.touch?"touchstart":"click",g=$(".header-chart-panel").eq(0);this._$right=g.find(".right");this._$left=g.find(".left");this._itemsVisibility=a.itemsVisibility;TradingView.isMobileView&&!TradingView.winMobileMode&&this._createBackButton(this);if(!b.readOnly()){if(D76.enabled("header_symbol_search")){var g=
|
|
this.createGroup().appendTo(this._$left),g=$('<div class="symbol-edit-widget no-last"></div>').appendTo(g),h=$('<div class="symbol-edit-wrap">').appendTo(g),g=null;D76.enabled("charting_library")||(g=$('<div class="symbol-edit-buttonswrap">').appendTo(h),g=$('<div class="spread-actions">').appendTo(g).on("mousedown",function(a){a.preventDefault()}));var k=$('<div class="symbol-edit-inputspacer">').appendTo(h),l=$('<input type="text" class="symbol-edit" maxlenght="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+
|
|
'">').appendTo(k);Q69.bindToInput(l,{syncWithChartWidget:!0,spreadActions:g});(function(){var a=!1;l.on("focus",function(){a=!0;h.addClass("expanded")});l.on("blur",function(){a=!1;setTimeout(function(){a||h.removeClass("expanded")},40)})})()}if(D76.enabled("header_resolutions")){g=this.createGroup({single:!0}).appendTo(this._$left);k={onWidget:d,submenuBtnAddClass:"apply-common-tooltip"};!TradingView.isMobileView&&D76.enabled("items_favoriting")||$.extend(k,{notShowQuicks:!0,
|
|
popupSpacing:1});TradingView.isOnFeaturePage&&$.extend(k,{notShowQuicks:!0});this._interval=new Q21(k);if(D76.enabled("charting_library"))Z15.on("configuration_received",function(){e._interval.forceUpdate()});this._interval.element().addClass("no-first").appendTo(g);this._interval.onResize.subscribe(b,b.updateLayout)}if(D76.enabled("header_chart_type")){g=D76.enabled("charting_library")?[{id:TradingView.Series.STYLE_BARS,title:$.t("Bars")},
|
|
{id:TradingView.Series.STYLE_CANDLES,title:$.t("Candles")},{id:TradingView.Series.STYLE_HOLLOW_CANDLES,title:$.t("Hollow Candles")},{id:TradingView.Series.STYLE_LINE,title:$.t("Line")},{id:TradingView.Series.STYLE_AREA,title:$.t("Area")},{id:TradingView.Series.STYLE_HEIKEN_ASHI,title:$.t("Heiken Ashi")}]:[{id:TradingView.Series.STYLE_BARS,title:$.t("Bars")},{id:TradingView.Series.STYLE_CANDLES,title:$.t("Candles")},{id:TradingView.Series.STYLE_HOLLOW_CANDLES,title:$.t("Hollow Candles")},{id:TradingView.Series.STYLE_HEIKEN_ASHI,
|
|
title:$.t("Heiken Ashi")},{id:TradingView.Series.STYLE_LINE,title:$.t("Line")},{id:TradingView.Series.STYLE_AREA,title:$.t("Area")},{id:TradingView.Series.STYLE_RENKO,title:$.t("Renko")},{id:TradingView.Series.STYLE_PB,title:$.t("Line Break")},{id:TradingView.Series.STYLE_KAGI,title:$.t("Kagi")},{id:TradingView.Series.STYLE_PNF,title:$.t("Point & Figure")}];e=this;k=[1,4,5,6];if(TradingView.isMobileView||TradingView.isOnFeaturePage)k=[];d&&(k=[1,3]);this._style_list=new Q14("StyleWidget",
|
|
$.map(g,function(a){var b=a.id,c={image:TradingView.wrapUrl("url('/static/chart-client/css/images/bartype-icons.png')"),offset:e.styleIconPosition(b),quickOffset:TradingView.isMobileView?"-%1px -38px".replace("%1",19*~~b):e.styleIconPosition(b),offsetActive:"-%1px -19px".replace("%1",19*~~b)};return{id:b,title:a.title,icon:c,favoriteButton:{icon:c,title:a.title,addClass:"apply-common-tooltip"}}}),{defaultFavorites:k,addClass:"chart-style-widget",popupAddClass:"chart-style-popup",notShowQuicks:!!TradingView.isMobileView||
|
|
!D76.enabled("items_favoriting"),tooltip:$.t("Bar's Style"),addTooltipClass:"apply-common-tooltip"});b.activeChartStyle.subscribe(function(a){e._style_list.setValue(a)},{callWithLast:!0});e._style_list.onChange().subscribe(this,function(a){b.activeChartStyle.setValue(a)});e._style_list.onResize().subscribe(b,b.updateLayout)}studyMarket=new Q1(b,window.user,{onWidget:d});this._createLayout(a,e,f)}this.Z3.readOnly()||TradingView.isMobileView||!D76.enabled("header_undo_redo")||
|
|
(this._undoRedo=new Q78(this._$right,this.Z3),this._undoRedo.undoElement().addClass("apply-common-tooltip"),this._undoRedo.redoElement().addClass("apply-common-tooltip"));!TradingView.isMobileView&&D76.enabled("header_fullscreen_button")&&(this._fullscreen=new TradingView.FullscreenWidget,this._fullscreen.element().addClass("apply-common-tooltip").appendTo(this._$right));D76.enabled("header_saveload")&&(a=$("<div>").addClass("save-load-buttons").appendTo(this._$right),
|
|
this._saveLoad=new TradingView.SaveLoadWidget(a,b,{popupDirection:"down",popupReverse:!0}));D76.enabled("header_widget_dom_node")||$(".header-chart-panel").css("display","none");c.withModel(this,Q4.prototype.bindToModel)};inherit(Q5,Q4);
|
|
Q5.prototype._createLayout=function(a,b,c){var d=[];D76.enabled("header_chart_type")&&d.push(this._createBarsGroup(b));D76.enabled("header_settings")&&d.push(this._createPropertiesGroup(c,a.Z5));D76.enabled("header_indicators")&&d.push(this._createIndicatorsGroup(c));D76.enabled("header_compare")&&d.push(this._createCompareGroup(b,a.Z5,c));d.forEach(function(a){a.appendTo(this._$left)},this)};TradingView.LineToolPropertiesWidget=function(a){this.Z4=a;this._bindings=new List;this.init();this.attachHandlers()};TradingView.LineToolPropertiesWidget.prototype._POSITION_KEY="properties_toolbar.position";TradingView.LineToolPropertiesWidget.prototype.activeChartWidget=function(){return this.Z4.activeChartWidget.value()};TradingView.LineToolPropertiesWidget.prototype.selectedSource=function(){return this.Z4.selectedSource.value()};
|
|
TradingView.LineToolPropertiesWidget.prototype.init=function(){var a=this,b=$('<div class="properties-toolbar"><div class="drag-handler"><i></i></div></div>').hide().appendTo("body").draggable({handle:".drag-handler",stop:function(){TVSettings.setJSON(a._POSITION_KEY,b.offset())}});$(window).resize(function(){a._updatePositoin()});this._$widget=b;this._$templates=$('<div class="tools-group">').hide().appendTo(b);this._$properties=$('<div class="tools-group properties-tools-group">').hide().appendTo(b);
|
|
this._$sourceActions=$('<div class="tools-group">').hide().appendTo(b);this.createSourceActions()};TradingView.LineToolPropertiesWidget.prototype.attachHandlers=function(){TradingView.drawingState.tool.subscribe(function(a){this.onToolChanged(a)}.bind(this),{callWithLast:!0});this.Z4.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 W51?b:new W51(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().size();b++)for(var c=this.activeChartWidget().model().panes().item(b).orderedSources(),d=0;d<c.length;d++)if(c[d]===a)return c[d]};
|
|
TradingView.LineToolPropertiesWidget.prototype.onSourceChanged=function(a){a?(a instanceof D46&&!(a instanceof D95)&&this.findSourceOnWidget(a)?(!a.userEditEnabled()||"LineToolBrush"!==a.toolname&&this.activeChartWidget().model().lineBeingCreated()?this.hideSourceActions():this.showSourceActions(),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){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:" ",buttonClass:"button icon-list with-arrow apply-common-tooltip",
|
|
defaultsCallback:function(){d.restoreFactoryDefaults();e.showPropertiesOf(c,d)},saveAsText:"Save Drawing Template As...",applyDefaultText:"Apply Default Drawing Template",getDataForSaveAs:b?function(){return b.template()}:null});var f=a.createButton().attr("title","Templates");this.templatesList=a;this._$templates.append(f);D76.enabled("charting_library")||this._$templates.show();this._templatesVisible=!0};
|
|
TradingView.LineToolPropertiesWidget.prototype.createSourceActions=function(){function a(a,b,c){return $('<div class="button icon-'+a.toLocaleLowerCase()+' apply-common-tooltip" title="'+b+'"></div>').click(function(a){a.stopPropagation();c(a)})}var b=this,c=a("Settings",$.t("Settings"),function(){(new EditObjectDialog(b.selectedSource(),b.activeChartWidget().model())).show()});this.$zOrder=a("ZOrder",$.t("Visual Order"),function(){b.zOrderButtonHandler()});this.$zOrder.addClass("with-arrow");TradingView.bindPopupMenu(this.$zOrder,
|
|
null,{direction:"down",event:"button-popup",reverse:!1,notCloseOnButtons:!0});this.$clone=a("Clone",$.t("Clone"),function(){b.activeChartWidget().paneWidgets().item(0).cloneLineTool(b.selectedSource())});this.$lock=a("Lock",$.t("Lock"),function(){b.activeChartWidget().toggleLockSelectedObject()});this._lockChangeListener=function(a){b.$lock.toggleClass("active",a.value())};var d=a("Hide",$.t("Hide"),function(){b.activeChartWidget().hideSelectedObject()}),e=a("Remove",$.t("Remove"),function(){b.activeChartWidget().model().removeSelectedSource()});
|
|
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._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)}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(){var a=TradingView.className(this.selectedSource().constructor);this.activeChartWidget().model().model().isSingleInstanceLineTool(a)?this.$clone.hide():this.$clone.show();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()};
|
|
TradingView.LineToolPropertiesWidget.prototype.show=function(){this._$widget.show();this._updatePositoin()};
|
|
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: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.append(a)};
|
|
TradingView.LineToolPropertiesWidget.prototype.clearBindings=function(a){for(a=this._bindings.size();a--;)this._bindings.item(a).destroy();this._bindings.clear()};
|
|
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=Z6.prototype.createColorPicker(),c.icon&&f.addClass("icon-"+c.icon),a.bindControl(new 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){return{value:a.value,html:'<div class="combobox-icon icon-'+a.icon+'"></div>'}});var g=new HTMLHelper.Combobox(f,{horizontal:e});f=g.render();e&&f.find(".items").width(32*c.comboboxOptions.length+14);c.propertyProxy&&(b=c.propertyProxy(d,a.activeChartWidget().model()));a.bindControl(new Z10(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].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].setValue(!1)):(d.beginUndoMacro(""),c[a].setValue(D46.LINEEND_NORMAL),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:!0},{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"},{value:1,icon:"line-dotted"},{value:2,icon:"line-dashed"}]},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:D46.LINEEND_NORMAL,icon:"line-left-normal"},{value:D46.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:D46.LINEEND_NORMAL,icon:"line-right-normal"},{value:D46.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:!0},{name:"fontsize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple",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:!0},{name:"fontSize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple",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:!0},{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")}]};
|
|
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:!0},{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"}]}]}};Q6=function(a){var b=this;a=a||{};TradingView.drawingState.init();var c=this._container=a.container;this.Z4=a.Z5;this._container.on("contextmenu",function(a){a.preventDefault()});if(!a.onWidget&&!TradingView.isMobileView){var d=$("<span>").addClass("main-menu apply-common-tooltip common-tooltip-vertical");c.append($("<div>").addClass("tools-group").append(d));this._mainMenuWidget=new TradingView.MainMenuWidget(d)}this._allToolGroups=
|
|
[];this._toolsFilter=a.drawingsAccess?new Q6.ModernToolsFilter(a.drawingsAccess):new Q6.ObsoleteToolsFilter(a.enabledDrawings,a.disabledDrawings);if(!a.readOnly){this._main=d=$("<div>").addClass("tools-group no-delimiter").appendTo(c);this.appendToolsGroup([{tool:"cursor",name:"Cross"},{tool:"dot",name:"Dot"},{tool:"arrow",name:"Arrow"},{tool:"eraser",name:"Eraser"}]);this.appendToolsGroup([{tool:"LineToolTrendLine",name:"Trend Line"},
|
|
{tool:"LineToolTrendAngle",name:"Trend Angle"},{tool:"LineToolHorzLine",name:"Horizontal Line"},{tool:"LineToolHorzRay",name:"Horizontal Ray"},{tool:"LineToolVertLine",name:"Vertical Line"},{tool:"LineToolArrow",name:"Arrow"},{tool:"LineToolRay",name:"Ray"},{tool:"LineToolExtended",name:"Extended"},{tool:"LineToolParallelChannel",name:"Parallel Channel"},{tool:"LineToolDisjointAngle",name:"Disjoint Angle"},{tool:"LineToolFlatBottom",name:"Flat Top/Bottom"},{tool:"LineToolRegressionTrend",name:"Regression Trend"}]);
|
|
this.appendToolsGroup([{tool:"LineToolPitchfork",name:"Pitchfork"},{tool:"LineToolSchiffPitchfork2",name:"Schiff Pitchfork"},{tool:"LineToolSchiffPitchfork",name:"Modified Schiff Pitchfork"},{tool:"LineToolInsidePitchfork",name:"Inside Pitchfork"},{tool:"LineToolPitchfan",name:"Pitchfan"},{tool:"LineToolGannSquare",name:"Gann Box"},{tool:"LineToolGannComplex",name:"Gann Square"},{tool:"LineToolGannFan",name:"Gann Fan"},{tool:"LineToolFibRetracement",name:"Fib Retracement"},{tool:"LineToolTrendBasedFibExtension",
|
|
name:"Trend-Based Fib Extension"},{tool:"LineToolFibSpeedResistanceFan",name:"Fib Speed Resistance Fan"},{tool:"LineToolFibTimeZone",name:"Fib Time Zone"},{tool:"LineToolTrendBasedFibTime",name:"Trend-Based Fib Time"},{tool:"LineToolCircleLines",name:"Cyclic Lines"},{tool:"LineToolFibCircles",name:"Fib Circles"},{tool:"LineToolFibSpiral",name:"Fib Spiral"},{tool:"LineToolFibSpeedResistanceArcs",name:"Fib Speed Resistance Arcs"},{tool:"LineToolFibWedge",name:"Fib Wedge"},{tool:"LineToolFibChannel",
|
|
name:"Fib Channel"}]);this.appendToolsGroup([{tool:"LineToolBrush",name:"Brush"},{tool:"LineToolRectangle",name:"Rectangle"},{tool:"LineToolRotatedRectangle",name:"Rotated Rectangle"},{tool:"LineToolEllipse",name:"Ellipse"},{tool:"LineToolTriangle",name:"Triangle"},{tool:"LineToolPolyline",name:"Polyline"},{tool:"LineToolArc",name:"Arc"}]);this.appendToolsGroup([{tool:"LineToolText",name:"Text"},{tool:"LineToolTextAbsolute",name:"Anchored Text"},{tool:"LineToolNote",name:"Note"},{tool:"LineToolNoteAbsolute",
|
|
name:"Anchored Note"},{tool:"LineToolCallout",name:"Callout"},{tool:"LineToolBalloon",name:"Balloon"},{tool:"LineToolPriceLabel",name:"Price Label"},{tool:"LineToolArrowMarkLeft",name:"Arrow Mark Left"},{tool:"LineToolArrowMarkRight",name:"Arrow Mark Right"},{tool:"LineToolArrowMarkUp",name:"Arrow Mark Up"},{tool:"LineToolArrowMarkDown",name:"Arrow Mark Down"},{tool:"LineToolFlagMark",name:"Flag Mark"}]);this.appendToolsGroup([{tool:"LineTool5PointsPattern",name:"XABCD Pattern"},{tool:"LineToolABCD",
|
|
name:"ABCD Pattern"},{tool:"LineToolTrianglePattern",name:"Triangle Pattern"},{tool:"LineToolThreeDrivers",name:"Three Drivers Pattern"},{tool:"LineToolHeadAndShoulders",name:"Head & Shoulders"},{tool:"LineToolElliottSubminuette",name:"Elliott Wave Subminuette"},{tool:"LineToolElliottMinor",name:"Elliott Wave Minor"},{tool:"LineToolElliottCircle",name:"Elliott Wave Cycle"},{tool:"LineToolElliottMinorRetr",name:"Elliott Minor Retracement"},{tool:"LineToolElliottMajorRetr",name:"Elliott Major Retracement"}]);
|
|
this.appendToolsGroup([{tool:"LineToolRiskRewardLong",name:"Long Position"},{tool:"LineToolRiskRewardShort",name:"Short Position"},{tool:"LineToolPrediction",name:"Forecast"},{tool:"LineToolDateRange",name:"Date Range"},{tool:"LineToolPriceRange",name:"Price Range"},{tool:"LineToolBarsPattern",name:"Bars Pattern"},{tool:"LineToolProjection",name:"Projection"}]);if(this._toolsFilter.isToolEnabled("Font Icons")){var e=new this.Button(this.createIconActions(),{addClass:"font-awesome line-tool-icons-popup",
|
|
buttonClass:"font-awesome"},!0);this._icons=e;d.append(e.element());this._allToolGroups.push(e)}if(!TradingView.isMobileView){d=$("<div>").addClass("tools-group").appendTo(c);e=new this.Button({tool:"zoom",name:"Zoom In",action:function(){TradingView.drawingState.tool.setValue("zoom")}});d.append(e.element());this._allToolGroups.push(e);if(b.Z4){var f=new this.Button({tool:"zoom-out",name:"Zoom Out",action:function(){var a=b.Z4;a&&(a=a.activeChartWidget.value().model())&&
|
|
a.zoomFromViewport()}});d.append(f.element());f.element().addClass("hidden");(function(){function a(){var d=b.Z4.activeChartWidget.value(),e=d.model(),g=!1;e?(c!==e&&(c&&c.zoomStack().onChange().unsubscribe(null,a),e.zoomStack().onChange().subscribe(null,a),c=e),g=!e.zoomStack().isEmpty()):d.withModel(null,a);f.element().toggleClass("hidden",!g)}var c=null;b.Z4.activeChartWidget.subscribe(a,{callWithLast:!0})})()}e=new this.Button({tool:"measure",name:"Measure (Shift + Click on the chart)",
|
|
action:function(){TradingView.drawingState.tool.setValue("measure")}});d.append(e.element());this._allToolGroups.push(e)}var d=$("<div>").addClass("tools-group").appendTo(c),e=!!TradingView.drawingState.properties().magnet.value(),g=new this.Button({tool:"magnet",name:"Magnet Mode",action:function(){g.activate(!g.activated);TradingView.saveDefaultProperties(!0);TradingView.drawingState.properties().magnet.setValue(g.activated);TradingView.saveDefaultProperties(!1)}.bind(this)});d.append(g.element());
|
|
g.activate(e);TradingView.drawingState.properties().magnet.subscribe(this,function(a){g.activate(a.value())});if(!a.onWidget&&!TradingView.isMobileView||D76.enabled("charting_library")){e=!!TradingView.drawingState.properties().stayInDrawingMode.value();drawingmode=new this.Button({tool:"drawginmode",name:"Stay in Drawing Mode",action:function(){drawingmode.activate(!drawingmode.activated);TradingView.saveDefaultProperties(!0);TradingView.drawingState.properties().stayInDrawingMode.setValue(drawingmode.activated);
|
|
TradingView.saveDefaultProperties(!1)}.bind(this)});d.append(drawingmode.element());drawingmode.activate(e);TradingView.drawingState.properties().stayInDrawingMode.subscribe(this,function(a){drawingmode.activate(a.value())});var e=!!TradingView.drawingState.lockDrawings().value(),h=new this.Button({tool:"lockAllDrawings",name:"Lock All Drawing Tools",action:function(){h.activate(!h.activated);TradingView.drawingState.lockDrawings().setValue(h.activated)}.bind(this)});d.append(h.element());h.activate(e);
|
|
TradingView.drawingState.lockDrawings().subscribe(this,function(a){h.activate(a.value())});var e=!!TradingView.drawingState.hideAllDrawings().value(),k=new this.Button({tool:"hideAllDrawings",name:"Hide All Drawing Tools",action:function(){k.activate(!k.activated);TradingView.drawingState.hideAllDrawings().setValue(k.activated)}.bind(this)});d.append(k.element());k.activate(e);TradingView.drawingState.hideAllDrawings().subscribe(this,function(a){k.activate(a.value())});d=$("<div>").addClass("tools-group").appendTo(c);
|
|
e=$("<span>").addClass("button objects-tree apply-common-tooltip common-tooltip-vertical").attr("title",$.t("Show Objects Tree")).append($("<i>"));e.on("click",function(a){this.Z4.activeChartWidget.value().showSourceProperties();a.preventDefault()}.bind(this));d.append(e)}TVSettings.getValue("chart.cursorPreference","cursor")}a.onWidget||TradingView.isMobileView||$(window).load(function(){if(window.widgetbar){var b=widgetbar.layout.setHelpButton();a.withWizard&&a.Z5&&
|
|
(Z2=a.Z5.activeChartWidget.value());new TradingView.ChartHelpMenu(b,!!a.withWizard,Z2)}});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||D76.enabled("charting_library")){var l=c.find(".tools-group"),m;$(window).load(function(){var a=
|
|
l.last();m=a.offset().top+a.outerHeight();$(window).resize()});$(window).resize(function(){var a=$(window).height()<m+10;a!=b._twoColumnLayout&&(c.toggleClass("two-column",a),b._twoColumnLayout=a,$(window).resize())})}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.onResize&&
|
|
(this.onResize=a.onResize);$(window).on("resize",this.updateLayout.bind(this))};Q6.prototype.updateLayout=function(){if(this.onResize)this.onResize(this._container)};Q6.prototype.appendToolsGroup=function(a){a=this.filterEnabledTools(this.applyActions(a));0<a.length&&(a=new this.Button(a),this._main.append(a.element()),this._allToolGroups.push(a))};
|
|
Q6.prototype.filterEnabledTools=function(a){return a.filter(function(a){return this._toolsFilter.isToolEnabled(a.name)},this)};Q6.prototype.element=function(){return this._container};
|
|
Q6.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)}}};
|
|
Q6.prototype.applyActions=function(a){var b=this;return $.map(a,function(a){return{tool:a.tool,name:a.name,addClass:b._toolsFilter.isToolGrayed(a.name)&&" grayed",action:function(){TradingView.drawingState.tool.value()!==a.tool&&(TradingView.supportTouch()&&b.Z4.selectedSource.value()&&b.Z4.activeChartWidget.value().model().lineBeingCreated()&&b.Z4.activeChartWidget.value().model().cancelCreatingLine(),TradingView.drawingState.tool.setValue(a.tool))}}})};
|
|
Q6.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;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)}}})};Q6.prototype.changeTool=function(a){a?this.Z3.setCurrentTool(a):this.Z3.setCurrentTool(this.Z3.currentCursorTool())};
|
|
Q6.prototype._fold=function(a){this._container.toggleClass("hidden",!!a);$(window).resize()};
|
|
Q6.prototype.Button=function(a,b,c){a=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.isGroup?(this._main=$("<span>").addClass("main"),c?this._main.text(this._firstNonGrayedTool().localizedName).addClass("text-as-icon"):this._main.append("<i>"),this._side=$("<span>").addClass("side"),this._e.append(this._main).append(this._side),this._e.addClass("subgroup")):
|
|
this._e.append($("<i>")).attr("title",this.tools[0].localizedName);c||this._e.hover($.proxy(this,"_hover"),$.proxy(this,"_unhover"));b=$.extend({direction:TradingView.isMobileView?"up":"right",event:"button-popup",addClass:"",reverse:!1,popupSpacing:TradingView.isMobileView?15:4,upAction:!0},b||{});c||(b.addClass+=" iconed");this.isGroup&&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"))};Q6.prototype.Button.prototype._isToolGrayed=function(a){return a.addClass&&-1<a.addClass.indexOf("grayed")};
|
|
Q6.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]};Q6.prototype.Button.prototype.element=function(){return this._e};
|
|
Q6.prototype.Button.prototype.setTools=function(a){if(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:$.t(a.name),tool:a.tool,addClass:a.addClass,action:"function"===typeof a.action?a.action:b._defaultAction}},this))}};Q6.prototype.Button.prototype._getBackgroundByTile=function(a,b){return[b?33:1,32*a+2]};
|
|
Q6.prototype.Button.prototype._getBackgroundPosition=function(a){return"-"+a[0]+"px -"+a[1]+"px"};
|
|
Q6.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,LineToolElliottSubminuette:40,LineToolElliottMinor:41,LineToolElliottCircle:42,LineToolElliottMajorRetr:43,LineToolElliottMinorRetr:44,LineToolRegressionTrend:45,LineToolFibWedge:46,zoom:47,LineToolPitchfan:48,LineToolHorzRay:49,LineToolPrediction:50,"zoom-out":51,LineToolPriceRange:52,LineToolDateRange:53,LineToolRiskRewardLong:54,LineToolRiskRewardShort:55,"":56,"":57,"":58,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,LineToolNote:83,LineToolNoteAbsolute:84};Q6.prototype.Button.prototype._setIcon=function(a,b,c){a=this._getBackgroundByTile(Q6.prototype.Button.iconIndices[a],b);c||this._e.find("i").css("background-position",this._getBackgroundPosition(a))};
|
|
Q6.prototype.Button.prototype._setTextAsIcon=function(a){this._e.find(".main").text(a)};Q6.prototype.Button.prototype.setIcon=function(a){this.icon=a;this.textAsIcon?this._setTextAsIcon(a):this._setIcon(a,this.activated)};Q6.prototype.Button.prototype._hover=function(){this._setIcon(this.icon,!0,!0)};
|
|
Q6.prototype.Button.prototype._unhover=function(){this._setIcon(this.icon,this.activated||!1)};Q6.prototype.Button.prototype._getPopupIcon=function(a){a=Q6.prototype.Button.iconIndices[a];return offset={image:TradingView.wrapUrl("url('/static/images/sidetoolbar/instruments.png')"),offset:{x:-64,y:32*-a}}};
|
|
Q6.prototype.Button.prototype._getPopupMenuItems=function(){var a=this;return $.map(this.tools,function(b,c){return b.separator?b:{title:""+b.localizedName,action:function(){a._isToolGrayed(b)?Z16.emit("onGrayedObjectClicked",{type:"drawing",name:b.name}):(a.setCurrent(c),b.action.call(a,b),$(document).trigger("click"),$(document).trigger("touch"))},active:c==a.current,icon:a.textAsIcon?null:a._getPopupIcon(b.icon),addClass:b.addClass}})};
|
|
Q6.prototype.Button.prototype._defaultAction=function(){this.activate()};Q6.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)};Q6.prototype.Button.prototype._stopclick=function(){this._delay&&(clearTimeout(this._delay),this._delay=null,this.action())};
|
|
Q6.prototype.Button.prototype._submenu=function(){this._e.hasClass("active")?$(document).trigger("click"):this.openSubmenu()};Q6.prototype.Button.prototype.activate=function(a){(this.activated=a=void 0!==a?!!a:!0)?this._e.addClass("selected"):this._e.removeClass("selected");this._setIcon(this.icon,a)};
|
|
Q6.prototype.Button.prototype.action=function(){var a=this.getCurrent();this._isToolGrayed(a)?Z16.emit("onGrayedObjectClicked",{type:"drawing",name:a.name}):a.action.call(this,a)};Q6.prototype.Button.prototype.openSubmenu=function(){this._e.trigger("button-popup",[this._getPopupMenuItems()])};
|
|
Q6.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.current=a}};Q6.prototype.Button.prototype.getCurrent=function(){return this.tools[this.current]};
|
|
Q6.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})};Q6.ObsoleteToolsFilter=function(a,b){this._enabledTools=a;this._disabledTools=b};
|
|
Q6.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)};Q6.ObsoleteToolsFilter.prototype.isToolGrayed=function(){return!1};
|
|
Q6.ModernToolsFilter=function(a){this._toolsAccess=a};Q6.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};Q6.ModernToolsFilter.prototype.isToolEnabled=function(a){return(a=this._findTool(a))&&a.grayed?!0:"black"==this._toolsAccess.type?!a:!!a};
|
|
Q6.ModernToolsFilter.prototype.isToolGrayed=function(a){return(a=this._findTool(a))&&a.grayed};Q78=function(a,b){a=$(a);this.Z3=b;this._undo=$("<span>").addClass("button undo iconed disabled").attr("title","").append("<i>").appendTo(a);this._redo=$("<span>").addClass("button redo iconed disabled").attr("title","").append("<i>").appendTo(a);var c=this;this._undo.click(function(){c.undo()});this._redo.click(function(){c.redo()});Q77.undoStack().onChange().subscribe(this,this.update);Q77.redoStack().onChange().subscribe(this,
|
|
this.update)};
|
|
Q78.prototype.update=function(){var a=Q77.undoStack(),b=Q77.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()||"")))};
|
|
Q78.prototype.undo=function(){this._undo.hasClass("disabled")||(TradingView.trackEvent("GUI","Undo"),Q77.undo())};Q78.prototype.redo=function(){this._redo.hasClass("disabled")||(TradingView.trackEvent("GUI","Redo"),Q77.redo())};Q78.prototype.undoElement=function(){return this._undo};Q78.prototype.redoElement=function(){return this._redo};TradingView.FullscreenWidget=function(){this.isFullscreen=!1;this._e=$("<span>").addClass("button fullscreen iconed").attr("title",$.t("Fullscreen mode")).append("<i>");var a=this;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;$("#chart-area").addClass("fullscreen");this._$exitButton||(this._$exitButton=$('<div class="exit-fullscreen">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(){var a=$("#chart-area");this._$exitButton&&($(".exit-fullscreen").remove(),delete this._$exitButton);a.removeClass("fullscreen");$(window).resize();$(document).off("keyup.toggleFullscreen")};Q53=function(a,b,c){this._chart=a;this.dialog=a.dialog;this._state=b;this._disableContextMenu=!!c;this.lhsPriceAxisWidget=new Q54(this,Q54.LHS);this.rhsPriceAxisWidget=new Q54(this,Q54.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 Q61(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 Q61(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 Q23(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._chart._jqMainDiv);this.rhsPriceAxisWidget.jqCell.appendTo(this.jqRow);this.setCursorForTool();TradingView.setMouseEventHandler($(this.top_canvas),this,!0);b&&b!==this._chart.model().panes().item(0)&&!this._chart.readOnly()&&(this.paneControls=new Q51(this,this._chart.model(),this._chart._jqMainDiv));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()};
|
|
Q53.prototype.destroy=function(){$(window).off("keyup.panewidget",this._onKeyUpListener);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]};
|
|
Q53.prototype._onKeyUpListener=function(a){27==a.keyCode&&(this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine(),this._chart.model().model().crossHairSource().clearMeasure(),this.setCursorForTool(),this._hideTooltip())};Q53.prototype._lineCancelledCallback=function(){try{this._chart.model().lineCancelled().subscribe(this,this._hideTooltip)}catch(a){}};Q53.prototype.backgroundColor=function(){return this._chart.properties().paneProperties.background.value()};
|
|
Q53.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};Q53.prototype.updateScalesVisibility=function(){this.lhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showLeftScale.value());this.rhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showRightScale.value())};
|
|
Q53.prototype.chart=function(){return this._chart};Q53.prototype.state=function(){return this._state};Q53.prototype.stretchFactor=function(){return this._state?this._state._stretchFactor:D74.DEFAULT_STRETCH_FACTOR};Q53.prototype.setStretchFactor=function(a){this._state&&(this._state._stretchFactor=a)};Q53.prototype.mouseEnterEvent=function(a){if(a=this._chart.model())a.crossHairSource().visible=!0};
|
|
Q53.prototype.isLineTool=function(a){a=TradingView[a];return"function"===typeof a&&a.prototype instanceof D46};Q53.prototype.hideInplaceEditor=function(){return this._inplaceEditor?(this._inplaceEditor.remove(),this._inplaceEditor=void 0,!0):!1};
|
|
Q53.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)-0.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)};
|
|
Q53.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()};
|
|
Q53.EvironmentState=function(a){a.shiftKey&&(this.shift=!0);a.ctrlKey&&(this.control=!0)};
|
|
Q53.prototype.mouseDownEvent=function(a){$("input").blur();$(window).focus();var b=this._chart.model(),c=new Q53.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)-0.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()==HitTestResult.CUSTOM){var g=e.hittest.data().mouseDownHandler;g&&g()}if(!this._chart.readOnly()){e&&!d.disableSelection&&b.setSelectedSource(e.source,e.hittest&&e.hittest.data());if(e.source&&"eraser"===TradingView.drawingState.tool.value()&&!d.disableErasing&&(isInherited(e.source.constructor,D46)||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&&isInherited(e.source.constructor,D46)&&e.source.isLocked();if(!this._lockDrawingsProperty.value()&&!d){if(e.source&&e.source.userEditEnabled&&!e.source.userEditEnabled())return;if(e.hittest&&e.hittest.result()===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&&
|
|
e.hittest.result()==HitTestResult.MOVEPOINT){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&&isInherited(e.source.constructor,PriceDataSource)){this._chart.draggingSource=e.source;return}}e.hittest&&e.hittest.result()==HitTestResult.REGULAR||(this._processing=!0)}else e.startMeasuring({price:d,
|
|
index:f,x:a.localX,y:a.localY},this._state)}};Q53.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 EditObjectDialog(a,b,c),a.show(),a.focusOnText())};
|
|
Q53.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)};Q53.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};
|
|
Q53.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",cursorCss(a.state.name,a.state.hotspot,a.theme)))};
|
|
Q53.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==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")})};Q53.prototype.setDragToAnotherPaneCursor=function(){this._setCursor({tool:"dragger",theme:"light",state:{name:"cursor_closed_hand_move",hotspot:"8 8"},crosshair:this.defaultPaneCursor("light")})};
|
|
Q53.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?cursorCss(c.name,c.hotspot,a):"default"};Q53.prototype.gestureStartEvent=function(a){this._prev_pinch_scale=1;this._pinching=!0};
|
|
Q53.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-0.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};Q53.prototype.gestureEndEvent=function(a){this._pinching=!1};
|
|
Q53.prototype.mouseMoveEvent=function(a){var b=this._chart.model();if(b){var c=a.localX,d=a.localY,e=new Q53.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();if(!this._processing&&(TradingView.drawingState.toolIsCursor(f)||"eraser"===f)){var g=this.dataSourceAtPoint(a.localX,a.localY);
|
|
this.setCursorForTool(g.source,g.hittest?g.hittest.result():null);g?!g.source||"eraser"===f&&g.source.constructor===TradingView.Series?b.setHoveredSource(null):b.setHoveredSource(g.source,g.hittest.data()):b.setHoveredSource(null)}}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))}}};
|
|
Q53.prototype.pressedMouseMoveEvent=function(a){if(!this._pinching){this._skipFirstMove?(delete this._skipFirstMove,delete this._touchMove):this._touchMove=!0;var b=new Q53.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){if(c.setCurrentPosition(d,e,this._state,b),this._updateTooltip(d,e),currentTool=TradingView.drawingState.tool.value(),!this.isLineTool(currentTool)||
|
|
"LineToolBrush"===f)if(0===a.button||Modernizr.touch)if("LineToolBrush"===currentTool){var 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}))}else 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",
|
|
cursorCss("cursor_closed_hand","8 8")),(f=this._chart.timeAxisByCanvas(f))&&f.jqCell.css("cursor",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(),isInherited(a.constructor,
|
|
D46)&&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))}}};
|
|
Q53.prototype._processMouseUpForCustomHandler=function(a){a=this.dataSourceAtPoint(a.localX,a.localY);a.hittest&&a.hittest.result()==HitTestResult.CUSTOM&&(a=a.hittest.data().mouseUpHandler)&&a()};
|
|
Q53.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.lineBeingCreated().finish();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(b.sourceBeingMoved()){b.endMovingSource();this._hideTooltip();return}f=this._isScrolling&&Q77.undoStack().head()instanceof 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=0.05*(a.localX-c),l=null,m=function(c){null===l&&(l=c);c=0.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,Q77.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,Q77.undo()),this._chart.model().move(this._chart.draggingSource,e._state,c);if(c=this._chart.timeAxisByCanvas(d))f&&(f=!1,Q77.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 q=b.lineBeingCreated().ownerSource().firstValue(),c=e.priceRange().convertToPercent(c,q);d=b.coninueCreatingLine({index:d.index,price:c},{});delete this._lastDrawingPoint}d&&this._finishTool(f)}};
|
|
Q53.prototype.mouseLeaveEvent=function(a){(a=this._chart.model())&&(TradingView.isMobile.any()||a.model().clearCurrentPosition())};Q53.prototype.mouseClickEvent=function(a){if(this._chart.model().hoveredSource()instanceof D95)this._chart.model().hoveredSource().onClicked()};
|
|
Q53.prototype.showEditDialogForSource=function(a){this.chart().onWidget()||a.userEditEnabled&&!a.userEditEnabled()||(this._editDialog=new EditObjectDialog(a,this._chart.model()),this._editDialog.show())};
|
|
Q53.prototype.mouseDoubleClickEvent=function(a){a=this.dataSourceAtPoint(a.localX,a.localY);if(!this._chart.readOnly()&&a&&a.source&&!(a.source instanceof D95||this.isLineTool(TradingView.drawingState.tool.value()))){var b=a.source;b&&b.customization&&b.customization.disableSelection||(b._metaInfo&&"Sessions@tv-basicstudies"==b._metaInfo.id&&(b=this._chart.model().mainSeries()),a.source instanceof TradingView.AlertLabel?editAlert(a.source.alert(),this._chart):this.showEditDialogForSource(b))}};
|
|
Q53.prototype.showContextMenuForSource=function(a,b){a.hasContextMenu()&&(this._chart.model().setSelectedSource(a),a.constructor===TradingView.Series?this._seriesContextMenu(a).show(b):isInherited(a.constructor,TradingView.ESDStudyBase)?this._studyEsdContextMenu(a).show(b):isInherited(a.constructor,TradingView.Study)?this._studyContextMenu(a).show(b):isInherited(a.constructor,PublishedChartsTimeline)?this._publishedChartsContextMenu(a).show(b):isInherited(a.constructor,D46)?
|
|
this._lineContextMenu(a).show(b):isInherited(a.constructor,TradingView.AlertLabel)&&!a.fake&&this._alertLabelContextMenu(a).show(b))};
|
|
Q53.prototype.contextMenuEvent=function(a,b){if(D76.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._zoomSelector.css("display","none"),delete this._firstZoomPoint),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),c=c?c.source:null;null===c?(this._contextMenu(a).show(a),this._chart.model().setSelectedSource(null)):this.showContextMenuForSource(c,a);this.paint()}else TradingView.isMobile.any()||(TradingView.drawingState.resetToCursor(!0),this.setCursorForTool(),this._hideTooltip(),this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine())};
|
|
Q53.prototype._contextMenu=function(a){this.actions.length||this._initActions();var b=this._customActions(),c=this.actions.slice();TradingView.Z17("alerts")&&!this.chart().onWidget()&&c.unshift(this.createActionAddAlert({e:a}));return ContextMenu.createMenu(b.top.concat(c).concat(b.bottom))};
|
|
Q53.prototype._initActions=function(){var a=this._chart.actions();this.actions=[];this.actions.push(a.chartReset);this.actions.push(a.symbolSearch);D76.enabled("charting_library")||this.actions.push(a.addToWatchlist);this.actions.push(new ActionSeparator);this.actions.push(a.paneObjectTree);this.actions.push(a.insertIndicator);TradingView.isMobile.any()||D76.enabled("charting_library")||this.actions.push(a.scriptEditor);this.actions.push(a.compareOrAdd);D76.enabled("charting_library")||
|
|
this.actions.push(a.applyStudyTemplate);this.actions.push(a.paneRemoveAllStudies);this.actions.push(a.paneRemoveAllDrawingTools);this.actions.push(a.lockDrawingsAction);this.actions.push(a.hideAllDrawingsAction);this.actions.push(new ActionSeparator);this.actions.push(a.applyTimeZone);D76.enabled("charting_library")||(this.actions.push(a.sessionBreaks),this.actions.push(a.extendedHours));this.actions.push(new ActionSeparator);D76.enabled("charting_library")||this.actions.push(a.applyColorTheme);
|
|
this.actions.push(a.chartProperties);pro.hasPackage("mtp-mtpredictor")&&this.state().containsMainSeries()&&(this.actions.push(new ActionSeparator),this.actions.push(this._createMTPredictorActions()))};
|
|
Q53.prototype._customActions=function(){var a={top:[],bottom:[]},b=this._chart.model().timeScale(),c=this._state.defaultPriceScale();if(b.isEmpty()||c.isEmpty())return a;D76.enabled("custom_items_in_context_menu")&&(b=b.indexToUserTime(b.coordinateToIndex(this._contextMenuX)),Z16.emit("onContextMenu",{unixtime:b?b/1E3:void 0,price:c.coordinateToPrice(this._contextMenuY),callback:function(b){[].concat(b).forEach(function(b){if(b.text){var c=new 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};
|
|
Q53.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 ActionSeparator,this.createActionShowLastValueLabels(a),this.createActionShowCountdown(a),new ActionSeparator,this.createActionScaleLeft(a),this.createActionScaleRight(a),this.createActionNoScale(a)],D76.enabled("countdown")||a.splice(3,1),d=ContextMenu.createMenu(a);else{d=this._mergeContentMenuItems(a);
|
|
c=[b.compare,c?b.seriesHide:this.createActionShow(a),this.createVisualOrderAction(a),new ActionSeparator,this.createActionShowLastValueLabels(a),this.createActionShowCountdown(a),new ActionSeparator];D76.enabled("countdown")||c.splice(5,1);this.chart().onWidget()||c.unshift(b.format);this.chart().canCreateAlertForDataSource(a)&&c.unshift(this.createActionAddAlert({datasource:a}));if(b=this.createActionLockScale(a))c.push(b),c.push(new ActionSeparator);if(0<d.length){for(b=0;b<d.length;b++)c.push(d[b]);
|
|
c.push(new ActionSeparator)}c.push(this.createActionScaleLeft(a));c.push(this.createActionScaleRight(a));c.push(this.createActionNoScale(a));pro.hasPackage("mtp-mtpredictor")&&(c.push(new ActionSeparator),c.push(this._createMTPredictorActions()));d=ContextMenu.createMenu(c)}return d};
|
|
Q53.prototype._createMTPredictorActions=function(){var a=this,b=function(b,d,e){b=new 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 Action({text:"MTPredictor",
|
|
subActions:[b("Apply Manual Risk/Reward","LineStudyMtpRiskReward",!1),b("Apply Manual Decision Point","LineStudyMtpDecisionPoint",!0),b("Analyze Trade Setup","LineStudyMtpAnalysis",!0),new Action({text:"Apply Elliot Wave",subActions:[b("Apply Elliot Wave Intermediate","LineStudyMtpElliotWaveMain",!0),b("Apply Elliot Wave Major","LineStudyMtpElliotWaveMajor",!0),b("Apply Elliot Wave Minor","LineStudyMtpElliotWaveMinor",!0)]}),new Action({text:"Apply WPT Up Wave",subActions:[b("Up Wave 1 or A","LineStudyMtpUpWave1OrA",
|
|
!1),b("Up Wave 2 or B","LineStudyMtpUpWave2OrB",!1),b("Up Wave C","LineStudyMtpUpWaveC",!1),b("Up Wave 3","LineStudyMtpUpWave3",!1),b("Up Wave 4","LineStudyMtpUpWave4",!1),b("Up Wave 5","LineStudyMtpUpWave5",!1)]}),new Action({text:"Apply WPT Down Wave",subActions:[b("Down Wave 1 or A","LineStudyMtpDownWave1OrA",!1),b("Down Wave 2 or B","LineStudyMtpDownWave2OrB",!1),b("Down Wave C","LineStudyMtpDownWaveC",!1),b("Down Wave 3","LineStudyMtpDownWave3",!1),b("Down Wave 4","LineStudyMtpDownWave4",!1),
|
|
b("Down Wave 5","LineStudyMtpDownWave5",!1)]})]})};Q53.prototype.createEarningsShow=function(a){var b=this._chart.model().mainSeries().properties().esdShowEarnings;a=new Action({checkable:!0,text:"Show Earnings",enabled:!0,checked:b.value()});a.callbacks().subscribe(this,function(a){this._chart.model().beginUndoMacro("Show Earnings");this._chart.model().setProperty(b,a.checked,"Show Earnings");this._chart.model().endUndoMacro()});return a};
|
|
Q53.prototype.createDividendsShow=function(a){var b=this._chart.model().mainSeries().properties().esdShowDividends;a=new Action({checkable:!0,text:"Show Dividends",enabled:!0,checked:b.value()});a.callbacks().subscribe(this,function(a){this._chart.model().beginUndoMacro("Show Dividends");this._chart.model().setProperty(b,a.checked,"Show Dividends");this._chart.model().endUndoMacro()});return a};
|
|
Q53.prototype.createSplitsShow=function(a){var b=this._chart.model().mainSeries().properties().esdShowSplits;a=new Action({checkable:!0,text:"Show Splits",enabled:!0,checked:b.value()});a.callbacks().subscribe(this,function(a){this._chart.model().beginUndoMacro("Show Splits");this._chart.model().setProperty(b,a.checked,"Show Splits");this._chart.model().endUndoMacro()});return a};
|
|
Q53.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 ContextMenu.createMenu(b)};
|
|
Q53.prototype._studyContextMenu=function(a){var b=this._chart.actions(),c=a.properties().visible.value(),d=[],e=null;if(!a.userEditEnabled())return e=ContextMenu.createMenu(d);if(a.properties().linkedToSeries&&a.properties().linkedToSeries.value())if(this._chart.readOnly())d.push(c?b.studyHide:this.createActionShow(a));else{this._chart.canCreateAlertForDataSource(a)&&d.push(this.createActionAddAlert({datasource:a}));d.push(b.format);d.push(c?b.studyHide:this.createActionShow(a));
|
|
d.push(this.createVisualOrderAction(a));c=a instanceof TradingView.study_PivotPointsStandard;if(0<a.properties().inputs.childCount()||c)d.push(new ActionSeparator),0<a.properties().inputs.childCount()&&d.push(this.createActionShowStudyArguments(a)),c&&d.push(this.createActionShowLastValueLabels(a));d.push(new ActionSeparator);d.push(b.studyRemove)}else this._chart.readOnly()?d=[c?b.studyHide:this.createActionShow(a),new ActionSeparator,this.createActionShowLastValueLabels(a),this.createActionShowStudyArguments(a),
|
|
new 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 ActionSeparator,this.createActionShowLastValueLabels(a),this.createActionShowStudyArguments(a),new ActionSeparator]),c=this._mergeContentMenuItems(a),c.length&&c.push(new ActionSeparator),
|
|
d=d.concat(c),d.push(this.createActionScaleLeft(a)),d.push(this.createActionScaleRight(a)),d.push(this.createActionNoScale(a)),d.push(new ActionSeparator),d.push(b.studyRemove),this._chart.canCreateAlertForDataSource(a)&&d.unshift(this.createActionAddAlert({datasource:a})));return e=ContextMenu.createMenu(d)};
|
|
Q53.prototype.createLineToolTemplateAction=function(a){var b=a.properties(),c=window.lineToolPropertiesToolbar.templatesList,d=new Action({text:$.t("Templates")});d.subActions||(d.subActions=[]);var e=d.subActions,f=new Action({text:$.t("Save As...")});f.callbacks().subscribe(this,function(){c.showSaveDialog(a)});e.push(f);f=new 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 ActionSeparator);$.each(a,function(a,d){var e=new 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 ActionPlaceholder(g);e.push(f);return d};
|
|
Q53.prototype._publishedChartsContextMenu=function(a){var b=this._chart.actions(),c=[];c.push(b.lineHide);if(is_authenticated){var b=new Action({checked:a.properties().filter.value()==PublishedChartsTimeline.FILTER_NONE,checkable:!0,text:$.t("Suggested ideas & my ideas"),callbackContext:{target:a,value:PublishedChartsTimeline.FILTER_NONE}}),d=new Action({checked:a.properties().filter.value()==PublishedChartsTimeline.FILTER_FOLLOWING,checkable:!0,text:$.t("Ideas of the people I follow & my ideas"),
|
|
callbackContext:{target:a,value:PublishedChartsTimeline.FILTER_FOLLOWING}});a=new Action({checked:a.properties().filter.value()==PublishedChartsTimeline.FILTER_PRIVATE,checkable:!0,text:$.t("My ideas only"),callbackContext:{target:a,value: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.D99.updateSource(a)};b.callbacks().subscribe(null,e);d.callbacks().subscribe(null,
|
|
e);a.callbacks().subscribe(null,e);c.push(new ActionSeparator);c.push(b);c.push(d);c.push(a)}return ContextMenu.createMenu(c)};
|
|
Q53.prototype._lineContextMenu=function(a){var b=this._chart.actions(),c=[];if(this._chart.readOnly())c.push(b.lineHide);else if(a.userEditEnabled()){PropertyPagesFactory.hasStylesPropertyPage(a,this._chart.model())&&c.push(b.format);c.push(b.lineHide);D76.enabled("charting_library")||c.push(this.createLineToolTemplateAction(a));c.push(this.createVisualOrderAction(a));c.push(new ActionSeparator);c.push(b.lineRemove);if(a.properties().clonable){c.push(new ActionSeparator);
|
|
var d=new Action({text:$.t("Clone"),callbackContext:{target:a}});d.callbacks().subscribe(this,Q53.prototype.cloneLineTool.bind(this,a));c.push(d)}if(a.additionalActions)for(c.push(new ActionSeparator),b=a.additionalActions(this._chart.model()),d=0;d<b.length;d++)c.push(b[d])}this._state.Z18();b=new List;if(1<b.size()){for(var e=[],d=0;d<b.size();d++){var f=b.item(d),f=new Action({checked:f===a.ownerSource(),checkable:!0,text:f.title(),callbackContext:{target:a,owner:f}});
|
|
f.callbacks().subscribe(null,this._lineContextMenu._actionCallback);e.push(f)}a=new Action({subActions:e,text:$.t("Link To")});c.push(new ActionSeparator);c.push(a)}return ContextMenu.createMenu(c)};Q53.prototype._alertLabelContextMenu=function(a){a=[this._createEditAlertAction(a),this._createStopAlertAction(a),this._createDeleteAlertAction(a),new ActionSeparator,this._createAlertToggleHorzLineAction(a),new ActionSeparator,this._createShowGlobalAlertPropertiesAction(a)];return ContextMenu.createMenu(a)};
|
|
Q53.prototype._createAlertToggleHorzLineAction=function(a){var b=a.properties().line.visible,c=new Action({checkable:!0,text:"Extend Alert Line",enabled:!0,checked:b.value()});c.callbacks().subscribe(this,function(a){a=a.checked;var c=(a?"Show":"Hide")+" alert label line";this._chart.model().setProperty(b,a,c)});c.setEnabled(a.globalProperties().line.visible.value());return c};
|
|
Q53.prototype._createShowGlobalAlertPropertiesAction=function(a){var b=this.chart();a=new 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};
|
|
Q53.prototype._createEditAlertAction=function(a){var b=this.chart(),c=new Action({text:"Edit Alert..."});c.callbacks().subscribe(this,function(){editAlert(a.alert(),b)});return c};Q53.prototype._createDeleteAlertAction=function(a){var b=new Action({text:"Delete Alert"});b.callbacks().subscribe(this,function(){deleteAlert(a.alert())});return b};
|
|
Q53.prototype._createStopAlertAction=function(a){var b=new Action({text:"Stop Alert"});b.callbacks().subscribe(this,function(){stopAlert(a.alert())});return b};
|
|
Q53.prototype._lineContextMenu._actionCallback=function(a){a=a.callbackContext();var b=[],c=a.target.priceScale();if(c.isPercent())var d=a.target.ownerSource().firstValue();for(var e=a.target.points().toArray(),f=this._chart,g=0;g<e.length;g++){var h=e[g].price;c.isPercent()&&(h=c.priceRange().convertToPercent(h,d));h=c.priceToCoordinate(h);b.push(h)}a.target.setOwnerSource(a.owner);c=a.owner.priceScale();f.model().move(a.target,that._state,c);for(g=0;g<b.length;g++)h=c.coordinateToPrice(b[g]),
|
|
d=e[g],d.price=h,a.target.setPoint(g,d);f.model().model().recalculateAllPanes()};Q53.prototype.cloneLineTool=function(a){this._chart.model().cloneLineTool(a)};Q53.prototype.adjustLegendPosition=function(){var a=this.jqPane.position().left,b=this.jqPane.position().top;TradingView.setAbsolutePos(this.legendWidget.jqTable,new TradingView.Point(a+5,b+5));this.paneControls&&this.paneControls.jqDiv.css({top:b+5,right:this.rhsPriceAxisWidget.size.w+5})};
|
|
Q53.prototype.setPriceAxisSize=function(a,b){this._priceAxisWidget(a).setSize(b)};Q53.prototype.setPriceAxisVisible=function(a,b){this._priceAxisWidget(a).setVisible(b);this._cachedStatus=null};Q53.prototype.resetPriceAxisOptimalWidth=function(a){this._priceAxisWidget(a).resetOptimalWidth();this._cachedStatus=null};
|
|
Q53.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.adjustLegendPosition(),this._cachedStatus=null,this.legendWidget.updateLayout())};
|
|
Q53.prototype.dataSourceAtPoint=function(a,b){var c=null,d=null;if(!this._state)return null;for(var e=new List(this._state.hitTestSources()),f=e.size();0<f--;){var g=e.item(f),h=g.paneViews(this._state);if(h){for(var k=h.size();0<k--;){var l=h.item(k).renderer();if(l&&l.hitTest&&(l=l.hitTest(new MathEx.Point(a,b)))){d=l;c=g;break}}if(c)break}}if(this.containsMainSeries())for(e=this._chart.model().barsMarksSources(),f=0;f<e.length;++f)for(g=e[f],h=g.paneViews(),f=0;f<h.size();f++)if(l=
|
|
h.item(f).renderer(),k=l.hitTest(new MathEx.Point(a,b))){d=k;c=g;break}null===c&&(c=this.legendWidget.dataSourceAtPoint(a,b));return{source:c,hittest:d}};Q53.prototype.update=function(){this.lhsPriceAxisWidget.update();this.rhsPriceAxisWidget.update();this.legendWidget.update()};Q53.prototype.drawBackground=function(a,b){clearRect(a,0,0,this.size.w,this.size.h,b)};
|
|
Q53.prototype.drawGrid=function(a){for(var b=this._chart.model().gridSource().paneViews(this._state),c=0;c<b.size();c++){a.save();var d=b.item(c).renderer();d&&d.draw(a);a.restore()}};Q53.prototype.drawWatermark=function(a){for(var b=this._chart.model().watermarkSource().paneViews(this._state),c=0;c<b.size();c++){a.save();var d=b.item(c).renderer();d&&d.draw(a);a.restore()}};
|
|
Q53.prototype.drawCrossHair=function(a){var b=this._chart.model().crossHairSource();this._drawSource(b,a)};Q53.prototype._drawSource=function(a,b){var c=a.paneViews(this._state);if(c)for(var d=0;d<c.size();d++){var e=c.item(d).renderer();e&&(b.save(),e.draw(b),b.restore())}};
|
|
Q53.prototype._drawSourceBackground=function(a,b){var c=a.paneViews(this._state);if(c)for(var d=0;d<c.size();d++){var e=c.item(d).renderer();e&&e.drawBackground&&(b.save(),e.drawBackground(b),b.restore())}};
|
|
Q53.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)}};Q53.prototype.disableDrawOnTop=function(a){return a&&a.hasOwnProperty("_metaInfo")&&"Volume@tv-basicstudies"===a._metaInfo.id};
|
|
Q53.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)};Q53.prototype.recalculatePriceScale=function(){var a=this._state;a.recalculatePriceScale(a.m_rightPriceScale);a.recalculatePriceScale(a.m_leftPriceScale);for(var b=0;b<a.Z18().size();++b){var c=a.Z18().item(b);a.isOverlay(c)&&(a.recalculatePriceScale(c.priceScale()),c.updateAllViews())}};Q53.prototype.containsMainSeries=function(){return this._state.containsMainSeries()};
|
|
Q53.prototype.drawBarsMarks=function(a,b){if(this.containsMainSeries()&&!b){var c=this;this._chart.model().barsMarksSources().map(function(b){c._drawSource(b,a)})}};
|
|
Q53.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.size();d++){var g=a.item(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)};
|
|
Q53.prototype.paint=function(a,b){if(a&&this._chart.model())if(this.lhsPriceAxisWidget.paint(a),this.rhsPriceAxisWidget.paint(a),a===Q22.FULL_UPDATE&&(this._cachedStatus=null),a===Q22.UPDATE_CURSOR_ONLY)this.top_ctx.clearRect(0,0,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(0,0,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))}};Q53.prototype.leftPriceAxisWidget=function(){return this.lhsPriceAxisWidget};Q53.prototype.rightPriceAxisWidget=function(){return this.rhsPriceAxisWidget};
|
|
Q53.prototype._priceAxisWidget=function(a){return Q54.isLeft(a)?this.lhsPriceAxisWidget:this.rhsPriceAxisWidget};Q53.prototype.statusWidget=function(){return this.legendWidget};Q53.prototype.onScaleLeft=function(a){a=a.callbackContext();this._state.leftPriceScale().Z18().contains(a)||this.chart().model().move(a,this._state,this._state.leftPriceScale())};
|
|
Q53.prototype.onScaleRight=function(a){a=a.callbackContext();this._state.rightPriceScale().Z18().contains(a)||this.chart().model().move(a,this._state,this._state.rightPriceScale())};Q53.prototype.onNoScale=function(a){a=a.callbackContext();this._state.isOverlay(a)||this.chart().model().move(a,this._state,null)};Q53.prototype.onRiskReward=function(a){a.callbackContext()};
|
|
Q53.prototype.createActionRiskReward=function(a){var b=new Action({checkable:!1,text:"Risk/Reward",enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,Q53.prototype.onRiskReward);return b};
|
|
Q53.prototype.createActionScaleLeft=function(a){var b=new Action({checkable:!0,text:$.t("Scale Left"),enabled:!0});b.setCallbackContext(a);b.setChecked(this._state.leftPriceScale().Z18().contains(a));b.callbacks().subscribe(this,Q53.prototype.onScaleLeft);return b};
|
|
Q53.prototype.createActionScaleRight=function(a){var b=new Action({checkable:!0,text:$.t("Scale Right"),enabled:!0});b.setCallbackContext(a);b.setChecked(this._state.rightPriceScale().Z18().contains(a));b.callbacks().subscribe(this,Q53.prototype.onScaleRight);return b};
|
|
Q53.prototype.createActionNoScale=function(a){var b=this._chart.model().paneForSource(a).actionNoScaleIsEnabled(a),b=new Action({checkable:!0,text:$.t("Screen (No Scale)"),enabled:b});b.setCallbackContext(a);b.setChecked(this._state.isOverlay(a));b.callbacks().subscribe(this,Q53.prototype.onNoScale);return b};
|
|
Q53.prototype.createActionShowStudyArguments=function(a){var b=new Action({checkable:!0,text:$.t("Show Arguments in Header"),enabled:!0});b._binding=new Z13(b,a.properties().showStudyArguments,this._chart.model(),b.text);b._binding.setValue(a.properties().showStudyArguments.value());return b};
|
|
Q53.prototype.createActionShowLastValueLabels=function(a){var b=new Action({checkable:!0,text:$.t("Last Value on Price Scale"),enabled:!0});b._binding=new Z13(b,a.properties().showLastValue,this._chart.model(),b.text);b._binding.setValue(a.properties().showLastValue.value());return b};
|
|
Q53.prototype.createActionShowCountdown=function(a){a=new Action({checkable:!0,text:"Show Countdown",enabled:!0});var b=this._chart.model().mainSeries().properties();a._binding=new Z13(a,b.showCountdown,this._chart.model(),a.text);a._binding.setValue(b.showCountdown.value());return a};
|
|
Q53.prototype.createActionLockScale=function(a){if(!(a instanceof TradingView.Series))return null;var b=new Action({checkable:a.properties().lockScale.value(),text:$.t("Lock Scale"),enabled:!0});b._binding=new Z13(b,a.properties().lockScale,this._chart.model(),b.text,function(b){this._undoModel.setLockScaleProperty(this._property,b.checked,a,this._undoText)});return b};
|
|
Q53.prototype.createActionMergeUp=function(a){if(this._chart.model().paneForSource(a)===this._chart.model().panes().item(0))return null;var b=new Action({checkable:!1,text:$.t("Merge Up"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,Q53.prototype.onMergeUp);return b};
|
|
Q53.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().item(b-1),c=b.findSuitableScale(a);this._chart.model().move(a,b,c)};
|
|
Q53.prototype.createActionUnmergeUp=function(a){if(!(1<this._chart.model().paneForSource(a).Z18().count(function(a){return isInherited(a.constructor,PriceDataSource)&&a.showInObjectTree()})))return null;var b=new Action({checkable:!1,text:$.t("Unmerge Up"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,Q53.prototype.onUnmergeUp);return b};
|
|
Q53.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)};
|
|
Q53.prototype.createActionMergeDown=function(a){var b=this._chart.model().paneForSource(a),c=this._chart.model().panes();if(b===c.item(c.size()-1))return null;b=new Action({checkable:!1,text:$.t("Merge Down"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,Q53.prototype.onMergeDown);return b};
|
|
Q53.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().item(b+1),c=b.findSuitableScale(a);this._chart.model().move(a,b,c)};
|
|
Q53.prototype.createActionUnmergeDown=function(a){if(!(1<this._chart.model().paneForSource(a).Z18().count(function(a){return isInherited(a.constructor,PriceDataSource)&&a.showInObjectTree()})))return null;var b=new Action({checkable:!1,text:$.t("Unmerge Down"),enabled:!0});b.setCallbackContext(a);b.callbacks().subscribe(this,Q53.prototype.onUnmergeDown);return b};
|
|
Q53.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)};
|
|
Q53.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};
|
|
Q53.prototype.createActionShow=function(a){var b=new Action({checkable:!0,text:$.t("Show"),enabled:!0});b._binding=new Z13(b,a.properties().visible,this._chart.model(),b.text);b._binding.setValue(a.properties().visible.value());return b};Q53.prototype.bringObjectForward=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().changeZOrder(a,1)};
|
|
Q53.prototype.sendObjectToBack=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().sendToBack(a)};Q53.prototype.bringObjectToFront=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().bringToFront(a)};Q53.prototype.sendObjectBackward=function(a){(a=this._chart.model().selectedSource())&&this._chart.model().changeZOrder(a,-1)};
|
|
Q53.prototype.createVisualOrderAction=function(a){var b=new Action({text:$.t("Visual Order")});b.subActions||(b.subActions=[]);var c=new Action({text:$.t("Bring to Front")});c.callbacks().subscribe(this,Q53.prototype.bringObjectToFront);b.subActions.push(c);var d=new Action({text:$.t("Send to Back")});d.callbacks().subscribe(this,Q53.prototype.sendObjectToBack);b.subActions.push(d);var e=new Action({text:$.t("Bring Forward")});e.callbacks().subscribe(this,
|
|
Q53.prototype.bringObjectForward);b.subActions.push(e);var f=new Action({text:$.t("Send Backward")});f.callbacks().subscribe(this,Q53.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};
|
|
Q53.prototype.createActionAddAlert=function(a){function b(a){void 0===a||null===a||isNaN(a)||(e+=" ("+a+") ",d.value=a)}var c=this._chart,d={},e="Add Alert",f=this._state;if(a.datasource){var g;a.datasource instanceof TradingView.Series?g=a.datasource.lastValueData(null,!0,!0).price:a.datasource instanceof TradingView.Study&&(f=a.datasource.metaInfo().plots[0].id,g=a.datasource.lastValueData(f,!0,!0).price);g&&(f=(a.datasource.priceScale()||this._state.mainDataSource().priceScale()||
|
|
c.model().mainSeries().priceScale()).formatter(),f.formatAsDecimal&&(g=f.formatAsDecimal(g)),b(g));d.series=a.datasource}else if(a.e){g=f.defaultPriceScale();a=g.coordinateToPrice(a.e.localY);if(g.isPercentage()){var 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}e+="...";a=new Action({text:e});a.callbacks().subscribe(null,function(){runOrSignIn(function(){new TradingView.MakeAlertDialog(c,
|
|
d)})});return a};Q53.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};Q53.prototype._updateTooltip=function(a,b){if(!this._rafSet){var c=this;requestAnimationFrame(function(){c._updateTooltipImpl(a,b);c._rafSet=!1});this._rafSet=!0}};
|
|
Q53.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"))}};
|
|
Q53.prototype._hideTooltip=function(){this._tooltipSelector.addClass("tooltip-selector-hidden")};function EditObjectDialog(a,b,c){this.D98=a;this.D99=b;this._undoCheckpoint=c}$.extend(EditObjectDialog,{TAB_PRIORITY_COORDINATES:100,TAB_PRIORITY_DISPLAY:100,TAB_PRIORITY_STYLE:200,TAB_PRIORITY_INPUTS:300,TAB_NAME_COORDINATES:"Coordinates",TAB_NAME_DISPLAY:"Properties",TAB_NAME_STYLE:"Style",TAB_NAME_INPUTS:"Inputs",TAB_NAME_GRAPHICS:"Graphics",TAB_OPEN_DEFAULT:100,TAB_OPEN_USERSAVE:200,TAB_OPEN_OVERRIDE:300});
|
|
EditObjectDialog.prototype.hide=function(){Q83.destroy(this._dialogTitle);$(window).unbind("keyup.hidePropertyDialog");if(window.lineToolPropertiesToolbar)window.lineToolPropertiesToolbar.onSourceChanged(this.D98)};EditObjectDialog.prototype.isVisible=function(){return this._dialog&&this._dialog.is(":visible")};EditObjectDialog.prototype.focusOnText=function(){this._dialog.find('input[type="text"]').focus().select()};
|
|
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}};
|
|
EditObjectDialog.prototype.appendToTab=function(a,b,c,d){if(!$(a).is("table")||$(a).find("tr").size()){var e;this._tabs||(this._tabs=[]);$.each(this._tabs,function(a,c){if(c.name==b)return e=a,!1});void 0===e&&(this._tabs.push({name:b,localizedName:$.t(b),objects:$(),displayPriority:0,defaultOpen:0}),e=this._tabs.length-1);var f=this._tabs[e];f.objects=f.objects.add(a);f.displayPriority=Math.max(f.displayPriority||0,c||0);f.defaultOpen=Math.max(f.defaultOpen||0,d||0)}};
|
|
EditObjectDialog.prototype.insertTabs=function(){if(this._tabs){this._tabs.sort(function(a,b){return(b.displayPriority||0)-(a.displayPriority||0)});var a=this,b=null,c=this.activeTabSettingsName();if(c)var d=TVSettings.getValue(c);$.each(this._tabs,function(c,f){d&&d===f.name&&(f.defaultOpen=Math.max(~~f.defaultOpen,EditObjectDialog.TAB_OPEN_USERSAVE));if(!b||~~b.defaultOpen<~~f.defaultOpen)b=f;f.labelObject=$('<a href="#" class="properties-tabs-label"></a>').text(f.localizedName).appendTo(a._tabContainer);
|
|
f.labelObject.bind("click",function(){a.switchTab(this,!0)});var g=$('<div class="main-properties"></div>');f.wrapperObject=$().add(g);f.objects.each(function(a,b){var c=$(b);c.is("table")?(c.data("layout-separated")&&(f.wrapperObject=f.wrapperObject.add('<div class="properties-separator"></div>').add(g=$('<div class="main-properties"></div>')),c.removeData("layout-separated")),g.append(c),c.children("tbody").each(function(a,c){if(0!==a&&$(c).data("layout-separated")){f.wrapperObject=f.wrapperObject.add('<div class="properties-separator"></div>').add(g=
|
|
$('<div class="main-properties"></div>'));var d=$(b).clone(!0,!1).appendTo(g);d.children().remove();d.append(c);$(c).removeData("layout-separated")}})):g.append(c)});f.wrapperObject.appendTo(a._container)});2>this._tabs.length?(this._tabContainer.remove(),$(".main-properties .property-page:first-child tbody:first-child tr:first-child td:last-child").css("padding-right","30px"),$(".main-properties").addClass("main-properties-tabless")):this.switchTab(b)}};
|
|
EditObjectDialog.prototype.activeTabSettingsName=function(){var a=this.D98;if(a){if(a instanceof TradingView.Series||a instanceof Q7)return"properties_dialog.active_tab.chart";if(a instanceof D46)return"properties_dialog.active_tab.drawing";if(a instanceof TradingView.Study)return"properties_dialog.active_tab.study"}};
|
|
EditObjectDialog.prototype.show=function(a){function b(){f.D99.undoToCheckpoint(f._undoCheckpoint?f._undoCheckpoint:q);f.hide()}a=a||{};isInherited(this.D98.constructor,Q7)&&TradingView.trackEvent("GUI","Chart Properties");isInherited(this.D98.constructor,TradingView.Study)&&TradingView.trackEvent("GUI","Study Properties");isInherited(this.D98.constructor,DataSource)&&this.D99.setSelectedSource(this.D98);var c=PropertyPagesFactory.createInputsPropertyPage(this.D98,
|
|
this.D99),d=PropertyPagesFactory.createStylesPropertyPage(this.D98,this.D99),e=PropertyPagesFactory.createDisplayPropertyPage(this.D98,this.D99);if(c||d){var f=this,g=null!==c,h=this.D98.title(),k=Q83.createDialog(h,{hideTitle:!0,dragHandle:".properties-tabs"}),l=k.find(".tv-dialog-content"),m=$('<div class="properties-tabs"></div>').appendTo(l),q=this.D99.createUndoCheckpoint();this._tabs=[];this._dialog=k;this._dialogTitle=h;this._dialog=k;this._container=l;this._tabContainer=
|
|
m;k.on("destroy",function(){c&&c.destroy();d&&d.destroy();e&&e.destroy()});a.selectScales&&d.setScalesOpenTab&&d.setScalesOpenTab();a.selectTmz&&d.setTmzOpenTab&&d.setTmzOpenTab();this.D99.readOnly()||!g||c.widget().is(":empty")||c.widget().each(function(a,b){var d=c instanceof W14,e=+$(b).data("layout-tab-priority");isNaN(e)&&(e=d?EditObjectDialog.TAB_PRIORITY_COORDINATES:EditObjectDialog.TAB_PRIORITY_INPUTS);var g=~~$(b).data("layout-tab-open"),h=$(b).data("layout-tab");
|
|
void 0===h&&(h=d?EditObjectDialog.TAB_NAME_COORDINATES:EditObjectDialog.TAB_NAME_INPUTS);f.appendToTab(b,h,e,g)});d&&d.widget().each(function(a,b){var c=+$(b).data("layout-tab-priority");isNaN(c)&&(c=EditObjectDialog.TAB_PRIORITY_STYLE);var e=~~$(b).data("layout-tab-open");!e&&d instanceof W49&&(e=EditObjectDialog.TAB_OPEN_DEFAULT);var g=$(b).data("layout-tab");void 0===g&&(g=EditObjectDialog.TAB_NAME_STYLE);f.appendToTab(b,g,c,e)});e&&e.widget().each(function(a,b){var c=
|
|
+$(b).data("layout-tab-priority");isNaN(c)&&(c=EditObjectDialog.TAB_PRIORITY_DISPLAY);var d=~~$(b).data("layout-tab-open"),e=$(b).data("layout-tab");void 0===e&&(e=EditObjectDialog.TAB_NAME_DISPLAY);f.appendToTab(b,e,c,d)});this.insertTabs();this.D98 instanceof TradingView.Study&&this.D98.metaInfo().isTVScript&&this.D98.metaInfo().TVScriptSourceCode&&!TradingView.isMobileView&&this._createOpenTVScriptEditor();this._helpItemRequired()&&this._createHelp();a=$('<div class="main-properties main-properties-aftertabs"></div>').appendTo(l);
|
|
a=$('<div class="dialog-buttons">').appendTo(a);g=function(){var a=[];d&&"function"==typeof d.defaultProperties&&(a=a.concat(d.defaultProperties()));c&&"function"==typeof c.defaultProperties&&(a=a.concat(c.defaultProperties()));0===a.length&&f.D98.properties?a=[f.D98.properties()]:f.D98._sessionsStudy&&(a=a.concat(f.D98._sessionsStudy.properties()));if(a.length){var b=function(a){a._childs&&a._childs.length&&$.each(a._childs,function(c,d){"percentage"==d?a.percentage.listeners().fire(a.percentage):
|
|
b(a[d])})};$.each(a,function(a,c){f.D99.restoreFactoryDefaults(c);b(c)});f.D98.properties().minTick&&f.D98.properties().minTick.listeners().fire(f.D98.properties().minTick);f.D98.properties().precision&&f.D98.properties().precision.listeners().fire(f.D98.properties().precision);c&&c.loadData();if(d.onResoreDefaults)d.onResoreDefaults();d&&d.loadData()}};d&&"function"==typeof d.createTemplateButton&&!D76.enabled("charting_library")?d.createTemplateButton({defaultsCallback:g}).addClass("tv-left").appendTo(a):
|
|
$('<a class="tv-button tv-left">'+$.t("Defaults")+"</a>").appendTo(a).click(g);$('<a class="tv-button ok">'+$.t("OK")+"</a>").appendTo(a).click(function(){f.hide()});$('<a class="tv-button cancel">'+$.t("Cancel")+"</a>").appendTo(a).on("click",b);k.find(".tv-dialog-title a").on("click",b);$(window).bind("keyup.hidePropertyDialog",function(a){"13"==a.keyCode&&"textarea"!==a.target.tagName.toLowerCase()&&(f.hide(),$(window).unbind("keyup.hidePropertyDialog"))});$("select",l).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"]',l).addClass("tv-text-input inset dialog");$("input.ticker",l).TVTicker();k.css("min-width","400px");Q83.applyHandlers(k);l={top:($(window).height()-k.height())/2,left:($(window).width()-k.width())/2};d&&"function"==typeof d.dialogPosition&&(l=d.dialogPosition(l,k)||l);Q83.positionDialog(k,l);window.lineToolPropertiesToolbar&&
|
|
window.lineToolPropertiesToolbar.hide();return k}};EditObjectDialog.prototype._helpItemRequired=function(){return this.D98._metaInfo&&!!this.D98._metaInfo.helpURL};EditObjectDialog.prototype._createHelp=function(){var a=$('<a class="help" href="#" target="_blank" title="'+$.t("Help")+'"></a>');a.attr("href",this.D98._metaInfo.helpURL);this._tabContainer.prepend(a)};
|
|
EditObjectDialog.prototype._createOpenTVScriptEditor=function(){var a=this;$('<a href="#" class="properties-tabs-label"></a>').text("Source Code").appendTo(this._tabContainer).bind("click",function(){a.hide();var b=this.D98.metaInfo();window.scriptEditor.show({scriptSource:b.TVScriptSourceCode,scriptIdPart:b.scriptIdPart})}.bind(this))};function ObjectTreeDialog(a,b){this._defaultOptions={maxHeight:550,padding:20,minHeight:258};this.options=$.extend({},this._defaultOptions,a||{});this.D99=b}
|
|
ObjectTreeDialog.prototype.getSourceProperties=function(){for(var a={groups:[],model:this.D99,drawings:[]},b=0;b<this.D99.panes().size();b++){for(var c=this.D99.panes().item(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.Z18();for(f=0;f<c.size();f++)g=c.item(f),isInherited(g.constructor,D46)&&a.drawings.push({datasource:g,name:g.title(),symbol:Q68.shortName(g.symbol())});d.length&&
|
|
a.groups.push({children:d})}return a};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};ObjectTreeDialog.prototype.tabChanged=function(a){0===a?this.objectsTreeTab.tabChanged():this.manageDrawingsTab.tabChanged()};ObjectTreeDialog.prototype.onDestroy=function(){this.objectsTreeTab.unsubscribeListeners();this.manageDrawingsTab&&this.manageDrawingsTab.unsubscribeListeners()};
|
|
ObjectTreeDialog.prototype.show=function(){this.title=$.t("Objects Tree");TradingView.trackEvent("GUI","Objects Tree");var a=window.user&&!0===user.is_staff&&!0!==user.is_moderator,b={};a&&$.extend(b,{hideTitle:!0,dragHandle:".properties-tabs"});var c=Q83.createDialog(this.title,b),d=c.find(".tv-dialog-content"),b=c.find(".tv-dialog-title");if(a){var e=$('<div class="properties-tabs"></div>').appendTo(d),f=$('<a href="#" class="properties-tabs-label with-filter"></a>').text($.t("Objects Tree")).appendTo(e);
|
|
$('<a href="#" class="properties-tabs-label"></a>').text($.t("Manage Drawings")).appendTo(e)}d=$("<div>").appendTo(d);a&&d.addClass("with-drawings");var g=$(window).height(),g=g>this.options.maxHeight?this.options.maxHeight:g;a&&(g-=e.height());var g=g-this.options.padding,h=$('<div class="main-tree-page active">').appendTo(d);if(a){h.addClass("no-top-border");var k=$('<div class="main-tree-page active">').appendTo(d)}this.objectsTreeTab=new ObjectsTreeTab(this,this.options,this.D99);a&&(this.manageDrawingsTab=
|
|
new ManageDrawingsTab(this,this.options,this.D99));this.objectsTreeTab.createView(h,a?f:b,g);a&&this.manageDrawingsTab.createView(k,g);a&&(this.tabs=new Q71(e,d,{saveTab:"ObjectsTreeDialog.tab"}));a&&this.tabs.tabChanged.subscribe(this,this.tabChanged);Q83.applyHandlers(c);Q83.positionDialog(c);var l=this;c.on("destroy",this.onDestroy.bind(this));setTimeout(function(){c.unbind("mousedownoutside");c.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")||
|
|
(Q83.destroy(l.title),c.unbind("mousedownoutside"))})})};ObjectTreeDialog._getBackgroundByTile=function(a){a=Q6.prototype.Button.iconIndices[a];return void 0!==a?[1,32*a+1]:null};ObjectTreeDialog._getBackgroundPosition=function(a){return"-"+a[0]+"px -"+a[1]+"px"};ObjectTreeDialog.List=function(a,b,c,d){this.model=a;this.datasources={};this.contentHeights=[];this.content=b;this.dialog=c;this.options=d};
|
|
ObjectTreeDialog.List.prototype.setDefaultItemClass=function(a){this.defaultItemClass=a};ObjectTreeDialog.List.prototype.setActiveListener=function(a){this.activeListener=a};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.Z19(new Q22(Q22.LIGHT_UPDATE))};
|
|
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(isInherited(a.datasource.constructor,D46)){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};ObjectTreeDialog.List.prototype.contextMenuEvent=function(a,b){this.options.Z2.paneByState(this.model.paneForSource(b)).showContextMenuForSource(b,a)};
|
|
ObjectTreeDialog.List.prototype.createPropertyIcon=function(a,b,c){var d=this;if(a.datasource instanceof D46&&!a.datasource.isActualSymbol())$('<div class="button hidden"> </div>').appendTo(b);else if(a.datasource===this.model.mainSeries()&&this.options.Z2&&this.options.Z2.onWidget())$('<div class="button hidden"> </div>').appendTo(b);else if(PropertyPagesFactory.hasStylesPropertyPage(a.datasource)||PropertyPagesFactory.hasInputsPropertyPage(a.datasource))b=
|
|
$('<a class="button format" title="'+$.t("Format")+'">').click(function(b){(new EditObjectDialog(a.datasource,d.model)).show()}).appendTo(b),$('<span class="icon">').appendTo(b),c.dblclick(function(b){(new EditObjectDialog(a.datasource,d.model)).show()}),c.on("contextmenu",function(b){d.contextMenuEvent(b,a.datasource);b.preventDefault();b.stopPropagation()})};
|
|
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)};ObjectTreeDialog.List.prototype.findItem=function(a){return this.content.find("#"+a.id())};ObjectTreeDialog.List.prototype.removeItem=function(a){this.findItem(a).remove()};
|
|
ObjectTreeDialog.List.prototype.setIcon=function(a,b){var c=a.find(".name-column");c.find(".instrument").remove();if(b.datasource.getType){var d=ObjectTreeDialog._getBackgroundByTile(b.datasource.getType());if(d){var e=$('<span class="instrument linetool">').appendTo(c);e.css("background-position",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=Q4.styleIconPosition(c),e.css("background-position",d))};ObjectTreeDialog.List.prototype.setVisible=function(a,b){b.datasource.properties().visible.value()?a.removeClass("hidden"):a.addClass("hidden")};function ManageDrawingsTab(a,b,c){this.dialog=a;this.options=b||{};this.model=c}ManageDrawingsTab.prototype.toolCompare=function(a,b){var c=$(a).find(".name").text(),d=$(b).find(".name").text();return c.localeCompare(d)};ManageDrawingsTab.prototype.symbolCompare=function(a,b){var c=$(a).find(".symbol").text(),d=$(b).find(".symbol").text();return c.localeCompare(d)};ManageDrawingsTab.prototype.activeListener=function(a){this.selectedId=a.attr("id")};
|
|
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))};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")})};
|
|
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)};
|
|
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()};
|
|
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 LoadChartDialog.SortObject(this.symbolCompare);this.toolSort=new LoadChartDialog.SortObject(this.toolCompare);this.list=new 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};
|
|
ManageDrawingsTab.prototype.unsubscribeListeners=function(){this.model.removeListener("setProperty",this.updateListListener);this.model.removeListener("removeSource",this.removeSourceListener);this.model.removeListener("cloneLineTool",this.fillListListener)};ManageDrawingsTab.prototype.updateList=function(){for(var a=this.dialog.getSourceProperties(),b=0;b<a.drawings.length;b++)this.list.updateItem(a.drawings[b])};
|
|
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())};
|
|
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()};
|
|
ManageDrawingsTab.prototype.addScroll=function(){this._scroll=new Q59(this.contentContainer,this.contentWrap,{showBottomShadow:!1})};ManageDrawingsTab.prototype.tabChanged=function(){};function ObjectsTreeTab(a,b,c){this.dialog=a;this.options=b||{};this.model=c}ObjectsTreeTab.prototype.activeListener=function(a){this.selectedId=a.attr("id")};ObjectsTreeTab.prototype.changeZOrder=function(a){this.model.removeListener("changeZOrder",this.changeZorderListener);a();this.model.on("changeZOrder",this.changeZorderListener)};
|
|
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())}})};
|
|
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.userEditEnabled()?(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)};
|
|
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 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 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};
|
|
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)};
|
|
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])}};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"))};
|
|
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)}}};ObjectsTreeTab.prototype.addScroll=function(){this._scroll=new Q59(this.contentContainer,this.contentWrap,{showBottomShadow:!1})};ObjectsTreeTab.prototype.tabChanged=function(){};
|
|
function ObjectsTreeTabFilter(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}
|
|
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))};ObjectsTreeTabFilter.prototype.value=function(){return this._value};ObjectsTreeTabFilter.prototype.setValue=function(a){a!=this._value&&(this._value=a,this.onChange.fire(a))};
|
|
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=!isInherited(c.datasource.constructor,TradingView.Series)&&!isInherited(c.datasource.constructor,"drawings"==this._value?D46:TradingView.Study);return a};Q23=function(a,b,c){this.D99=b;this._paneWidget=a;this._chart=a._chart;this._mainDiv=c;this.jqTable=$(document.createElement("table"));TradingView.setAbsolutePos(this.jqTable,new TradingView.Point(10,10));this.jqTable.addClass("pane-legend");this._itemsBinding=new List;this.updateLayout()};
|
|
Q23.prototype.contextMenuEvent=function(a,b){!this.D99.chartModel().readOnly()&&D76.enabled("legend_context_menu")&&this._paneWidget.showContextMenuForSource(b.source,a)};
|
|
Q23.prototype.updateLayout=function(){this._itemsBinding.clear();this.jqTable.empty();var a=this._paneWidget.state();if(a&&this.D99){var b=new List,c=a.orderedSources().slice(),a=c.indexOf(this.D99.mainSeries());-1<a&&(c.splice(a,1),c.push(this.D99.mainSeries()));for(a=c.length-1;0<=a;a--){var d=c[a],e=d.statusView();e&&b.append({view:e,source:d})}for(a=0;a<b.size();++a){var e=b.item(a).view,d=b.item(a).source,c=$("<tr>"),f=$("<td>"),g=this._paneWidget.jqPane.width();
|
|
f.css("max-width",g-85);c.appendTo(this.jqTable);f.addClass("pane-legend-line");d==this.D99.mainSeries()?f.addClass("main"):f.addClass("study");d.properties().visible.value()||f.addClass("disabled");f.appendTo(c);f.source=d;this._generateItemsForRow(f,e);TradingView.setMouseEventHandler(f,this,!0)}this.update();this.updateTitle()}};
|
|
Q23.prototype._updateFollowSymbol=function(a,b){if(!this._chart.onWidget()&&!D76.enabled("charting_library")){var c=$(document.createElement("span")).data("alive",!0).appendTo(a);Q16.makeButton(b.properties().symbol.value(),"iconed").done(function(a){if(c.data("alive")){a.removeAttr("title");var b=Q68.ticker(a.data("symbol")||"");a.blueTooltip("<strong>Follow "+b+".</strong> If you follow a symbol you will receive notifications when new ideas about that symbol are published.",
|
|
"bottom");c.replaceWith(a)}})}};
|
|
Q23.prototype._generateItemsForRow=function(a,b){var c=$("<span>");c.addClass("pane-legend-line");D76.enabled("legend_context_menu")||c.addClass("no-context-menu");var d=a.source,e=this,f=d==this.D99.mainSeries();f&&c.addClass("main");d.properties().visible.value()||c.addClass("disabled");c.css({"font-weight":b.bold()?"bold":"normal","font-size":b.size()});c.click(function(b){e.contextMenuEvent(b,a)});c.appendTo(a);this._itemsBinding.append({value:b,cell:c,source:a.source});
|
|
if(!this._chart.readOnly()&&d.userEditEnabled()&&D76.enabled("edit_buttons_in_legend")){c=$('<span class="pane-legend-icon-container">').appendTo(a);$('<a class="pane-legend-icon apply-common-tooltip icon-hide" title="'+$.t("Show/Hide")+'">').appendTo(c).on("click touchend",this._generateItemsForRow._onShowhideClick.bind(this,d));$('<a class="pane-legend-icon apply-common-tooltip format" title="'+$.t("Format")+'">').appendTo(c).on("click touchend",this._generateItemsForRow._onFormatClick.bind(this,
|
|
d));if(d instanceof TradingView.Study&&d.metaInfo().isTVScript&&d.metaInfo().TVScriptSourceCode&&!TradingView.isMobileView){var g=$('<a class="pane-legend-icon apply-common-tooltip source" title="Show Source Code">').appendTo(c).on("click touchend",this._generateItemsForRow._onViewSorceClick.bind(this,d));if(window.scriptEditor){var h=window.scriptEditor.loadedScriptIdPart();h&&d.metaInfo().scriptIdPart===h&&g.addClass("active")}}if(!f)$('<a class="pane-legend-icon apply-common-tooltip delete" title="'+
|
|
$.t("Delete")+'">').appendTo(c).on("click touchend",this._generateItemsForRow._onDeleteClick.bind(this,d))}else $("<span> </span>").appendTo(a);c=d.dataWindowView();c=d.dataWindowView();if(this.isDataWindowValuesVisible(c)){var g=[],h=[],k=$("<div>");k.addClass("pane-legend-item-value-container");for(var l=0;l<c.items().size();l++){c.items().item(l);var m=f?$("<span class='pane-legend-item-value-title pane-legend-line'>").appendTo(k):null,q=$("<span class='pane-legend-item-value pane-legend-line'>").appendTo(k);
|
|
f&&q.addClass("main");d.properties().visible.value()||(q.addClass("disabled"),m&&m.addClass("disabled"));g.push(q);m&&h.push(m)}l=$("<span class='pane-legend-item-additional pane-legend-line'>").appendTo(k);k.appendTo(a);this._itemsBinding.append({value:c,cell:g,titleCells:h.length?h:null,source:d,additional:l})}TradingView.Z17("alerts")&&!this._chart.onWidget()&&f&&(d=$('<span class="pane-legend-icon-container">').appendTo(a),this.alertWidget&&this.alertWidget.destroy(),this.alertWidget=
|
|
new TradingView.AlertsLegendWidget(d,this.D99),window._exposed_AlertsLegendWidget=this.alertWidget)};Q23.prototype.isDataWindowValuesVisible=function(a){return this._chart.onWidget()?!!a&&!this._chart.isSmall():!!a};Q23.prototype._generateItemsForRow._onShowhideClick=function(a){this.D99.setProperty(a.properties().visible,!a.properties().visible.value(),"Show/Hide "+a.title())};
|
|
Q23.prototype._generateItemsForRow._onFormatClick=function(a,b){a.userEditEnabled()&&(new EditObjectDialog(a,this.D99)).show()};Q23.prototype._generateItemsForRow._onDeleteClick=function(a){a.isUserDeletable()&&this.D99.removeSource(a)};Q23.prototype._generateItemsForRow._onViewSorceClick=function(a){var b=a.metaInfo();a={scriptSource:a.metaInfo().TVScriptSourceCode,scriptIdPart:b.scriptIdPart};window.scriptEditor&&window.scriptEditor.show(a)};
|
|
Q23.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"))};
|
|
Q23.prototype.updateTitle=function(){var a=this._chart.properties().scalesProperties.textColor.value();this.jqTable.css("color",a);for(var a=this._itemsBinding.size(),b,c;a--;){c=this._itemsBinding.item(a);var d=c.source;isArray(c.cell)||(b=d.properties().visible.value(),this.setItemEnabled(c.cell,b),b=c.value.color(),d=d!=this.D99.mainSeries()&&d===this.D99.selectedSource()?"bold":"normal",c.cell.html(c.value.text()).css({color:b,"border-color":b,"font-weight":d}))}};
|
|
Q23.prototype.update=function(){this.updateTitle();for(var a,b,c,d,e,f,g,h=this._itemsBinding.size();h--;)if(d=this._itemsBinding.item(h),a=d.cell,b=d.titleCells,c=d.source.properties().visible.value(),isArray(a)){e=d.value.items();for(f=0;f<a.length;f++)g=e.item(f),this.setItemEnabled(a[f],c),a[f][0].textContent=g.text(),g.color()&&a[f].css("color",g.color()),b&&(this.setItemEnabled(b[f],c),b[f][0].textContent=g.title());d.additional&&d.value.additional&&d.additional.text(d.value.additional()||
|
|
"")}};Q23.prototype.dataSourceAtPoint=function(a,b){return null};Q23.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.size();++e){var f=this._itemsBinding.item(e),g=f.value,h=f.source==this.D99.mainSeries(),k=h?12:8,h=h?25:17;isArray(f.cell)||(a.font=g.size()+" Verdana, Arial",a.fillText(g.text(),b,c+d+k),d+=h)}a.restore()};Q52=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(Q52.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",cursorCss("cursor_size_vertical","16 15"));TradingView.setMouseEventHandler(this.handle,this)};Q52.HEIGHT=1;
|
|
Q52.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};
|
|
Q52.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()}};
|
|
Q52.prototype.mouseUpEvent=function(a){if(0===a.button||Modernizr.touch)this.chart.D99.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};Q52.prototype.update=function(){this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value())};
|
|
Q52.prototype.paint=function(){};
|
|
Q52.prototype.image=function(){var a={},b=Q52.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};Q51=function(a,b,c){this.D99=b;this._paneWidget=a;this._chart=a._chart;this._pane=a.state();this._mainDiv=c;this.jqDiv=$('<div class="pane-controls">').appendTo(c);this.jqDiv.css({position:"absolute",right:"5px",top:"5px"});this.updateLayout()};
|
|
Q51.prototype.updateLayout=function(){var a=this,b=this.D99.panes().indexOf(this._pane),c=0,d=0;0<b&&$('<a class="pane-legend-icon up" title="{0}">'.format($.t("Move Up"))).click(function(){a.D99.rearrangePanes(a._chart,b,"up")}).appendTo(this.jqDiv);for(b<this.D99.panes().size()-1&&$('<a class="pane-legend-icon down" title="{0}">'.format($.t("Move Down"))).click(function(){a.D99.rearrangePanes(a._chart,b,"down")}).appendTo(this.jqDiv);d<this._pane.Z18().size();++d)this._pane.Z18().item(d).constructor===
|
|
TradingView.Study&&++c;1<c&&!this._paneWidget.containsMainSeries()&&$('<a class="pane-legend-icon delete" title="{0}">'.format($.t("Delete"))).click(function(){a.D99.removePane(a._chart,b)}).appendTo(this.jqDiv)};Q51.prototype.update=function(){};Q54=function(a,b,c){this.pane=a;this._isLeft=Q54.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 Q61(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 Q61(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.restoreDefaultCursor();this.update();TradingView.setMouseEventHandler(this.jqCell,this,!0);this.dialog=this.pane.chart().dialog;this.contextMenu=null;this.actions={};this._isVisible=!0};Q54.prototype._BORDER_SIZE=1;Q54.prototype._MAJOR_TICK_LENGTH=4;Q54.prototype._MINOR_TICK_LENGTH=2;Q54.LHS=1;Q54.RHS=2;
|
|
Q54.isLeft=function(a){if(a===Q54.LHS)return!0;a!==Q54.RHS&&TradingView.logDebug("PriceAxisWidget.isLeft: wrong side");return!1};Q54.prototype.backgroundColor=function(){return this.pane.chart().model().model().properties().paneProperties.background.value()};Q54.prototype.lineColor=function(){return this.pane.chart().model().model().properties().scalesProperties.lineColor.value()};
|
|
Q54.prototype.textColor=function(){return this.pane.chart().model().model().properties().scalesProperties.textColor.value()};Q54.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",cursorCss("cursor_size_vertical","15 15"));b.startScalePrice(c,this.priceScale(),a.localY);TradingView.trackEvent("GUI","Scaling price scale")}};
|
|
Q54.prototype.pressedMouseMoveEvent=function(a){var b=this.pane.chart().model(),c=this.pane.state(),d=this.priceScale();b.scalePriceTo(c,d,a.localY)};Q54.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())};
|
|
Q54.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()};
|
|
Q54.prototype._initActions=function(a){if(this.pane.state()){var b=this;this.actions.reset=new Action({text:$.t("Reset Scale")});this.actions.reset.callbacks().subscribe(this,Q54.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 Action({text:$.t("Lock Scale"),
|
|
checkable:!0,checked:this.priceScale().mainSource().properties().lockScale.value()}),this._lockScaleBinding=new Z13(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 Action({text:$.t("Auto Scale"),checkable:!0,checked:!0});this._autoScaleBinding=new Z13(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 Action({text:$.t("Percentage",{context:"scale_menu"}),checkable:!0,checked:!1});this.actions.setPercentage.binding=new Z13(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 Action({text:$.t("Log Scale",{context:"scale_menu"}),checkable:!0,checked:!1});this.actions.setLog.binding=new Z13(this.actions.setLog,this.priceScale().properties().log,this.pane.chart().model(),"Undo Log Scale");this.actions.showSymbolNames=new Action({text:$.t("Show Symbol Labels",{context:"scale_menu"}),checkable:!0,checked:!1});this.actions.showSymbolNames.binding=
|
|
new Z13(this.actions.showSymbolNames,this.priceScale().properties().showSymbolLabels,this.pane.chart().model(),"Undo Show Symbol Labels");this._updateScalesActions()}};
|
|
Q54.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.Z1.autoScale.value());this.actions.setAutoScale.setEnabled(!a.properties().autoScaleDisabled.value())};
|
|
Q54.prototype.mouseClickEvent=function(a){};Q54.prototype.mouseDoubleClickEvent=function(a){this.reset();TradingView.trackEvent("GUI","Double click price scale")};Q54.prototype.contextMenuEvent=function(a,b){!this._disableContextMenu&&D76.enabled("scales_context_menu")&&this._createContextMenu().show(a)};
|
|
Q54.prototype._createContextMenu=function(){this._initActions();var a=this.pane.chart().actions(),b=[this.actions.reset,new ActionSeparator,a.showLeftAxis,a.showRightAxis,new ActionSeparator,this.actions.setAutoScale,a.scaleSeriesOnly,new ActionSeparator,this.actions.setPercentage,this.actions.setLog,new ActionSeparator,this.actions.showSymbolNames];D76.enabled("countdown")&&b.push(a.showCountdown);TradingView.onWidget()||(b.push(new ActionSeparator),b.push(a.scalesProperties));
|
|
this.actions.setLockScale&&b.splice(6,0,this.actions.setLockScale);return ContextMenu.createMenu(b)};
|
|
Q54.prototype.backLabels=function(a){var b=new List,c=this.priceScale().orderedSources().clone().toArray(),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().Z18(),e=0;e<g.size();e++)d.isOverlay(g.item(e))&&c.push(g.item(e));for(e=
|
|
0;e<c.length;++e)g=c[e],(a||-1===f.indexOf(g))&&(g=g.priceAxisViews(d,g.priceScale()))&&b.appendAll(g);return b};
|
|
Q54.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";try{b.font=this.baseFont}catch(d){}$.each(c,function(){var c=Math.round(b.measureText(this.label).width+10);c>a&&(a=c)});try{b.font=this.labelFont}catch(e){}for(var c=this.backLabels(!0),f=0;f<c.size();f++){if(c.item(f).font){var g=b.font;b.font=c.item(f).font()}var h=Math.round(b.measureText(c.item(f).text()).width+
|
|
10);h>a&&(a=h);c.item(f).font&&(b.font=g)}}return this._optimalWidth=this._BORDER_SIZE+this._MAJOR_TICK_LENGTH+a+-1};Q54.prototype.resetOptimalWidth=function(){this._optimalWidth=0};Q54.prototype.setFont=function(a,b,c){this.labelFont=this.baseFont=makeFont(a,b,c);this.fontSize=a};
|
|
Q54.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.jqCell.css({width:a.w,"min-width":a.w,height:a.h}))};Q54.prototype.update=function(){};
|
|
Q54.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);clearRect(a,1,d,this.size.w-1,e-d,"rgba(109, 158, 235, 0.3)")};
|
|
Q54.prototype.drawBackground=function(a){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 D46){var d=c.points();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())};
|
|
Q54.prototype.drawBorder=function(a){a.save();a.fillStyle=this.lineColor();var b=this.size.h;if(this._isLeft){a.translate(-0.5,-0.5);var c=this.size.w-this._BORDER_SIZE-1,d=this.size.w-1}else a.translate(0.5,-0.5),c=0,d=c+this._BORDER_SIZE;a.fillRect(c,0,d-c,b);a.restore()};
|
|
Q54.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();try{a.font=this.baseFont}catch(c){}var d=this.size.w-1;a.translate(-0.5,-0.5);var e=b.length,f;if(this._isLeft){f=d-this._BORDER_SIZE;for(a.fillStyle=this.lineColor();e--;)d=b[e].major?this._MAJOR_TICK_LENGTH:this._MINOR_TICK_LENGTH,a.fillRect(f-d,b[e].coord,d,1);a.fillStyle=
|
|
this.textColor();for(e=b.length;e--;)a.fillText(b[e].label,f-this._MAJOR_TICK_LENGTH,b[e].coord)}else{f=this._BORDER_SIZE+1;for(a.fillStyle=this.lineColor();e--;)d=b[e].major?this._MAJOR_TICK_LENGTH:this._MINOR_TICK_LENGTH,a.fillRect(f,b[e].coord,d+1,1);a.fillStyle=this.textColor();for(e=b.length;e--;)a.fillText(b[e].label,f+this._MAJOR_TICK_LENGTH+1,b[e].coord)}a.restore()};
|
|
Q54.prototype.drawBackLabels=function(a){a.save();try{a.font=this.labelFont}catch(b){}for(var c=this.backLabels(),d=0;d<c.size();d++)c.item(d).renderer().draw(a,this._isLeft,this.size.w,this.size.h);a.restore()};
|
|
Q54.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()});for(b=0;b<c.length;b++)if(d=c[b],
|
|
d=d.source.priceAxisViews(this.pane.state(),d.scale)){a.save();try{a.font=this.labelFont}catch(e){}for(var f=0;f<d.size();f++)d.item(f).renderer().draw(a,this._isLeft,this.size.w,this.size.h);a.restore()}};Q54.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]};
|
|
Q54.prototype.isVisible=function(){return this._isVisible};Q54.prototype.setVisible=function(a){(this._visible=a)?this.jqCell.show():this.jqCell.hide();this._isVisible=!!a};Q54.prototype.setAutoScale=function(a){var b=this.pane.state,c=this.priceScale();this.pane.chart().model().setPriceAutoScale(b,c,a)};
|
|
Q54.prototype.reset=function(){var a=this.pane.state(),b=this.priceScale();this.pane.chart().model().resetPriceScale(a,b)};
|
|
Q54.prototype.paint=function(a){this._isVisible&&a&&(a===Q22.UPDATE_CURSOR_ONLY?(this.top_ctx.clearRect(0,0,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(0,0,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx))))};
|
|
Q54.prototype.restoreDefaultCursor=function(){this.jqCell.css("cursor","default")};Q54.prototype.image=function(){var a={};a.content=this.canvas.toDataURL();a.contentWidth=this.size.w;a.contentHeight=this.size.h;return a};Q73=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 Q61(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 Q61(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 Q61(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 Q61(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.restoreDefaultCursor();this.update();this._minVisibleSpan=MINUTE_SPAN;TradingView.setMouseEventHandler(this.jqCell,this,!0);this.updatePriceScalesVisibility()};Q73.prototype.BORDER_SIZE=1;
|
|
Q73.prototype.MAJOR_TICK_LENGTH=4;Q73.prototype.MINOR_TICK_LENGTH=2;Q73.prototype.backgroundColor=function(){var a=this.chart.model();return a?a.model().properties().paneProperties.background.value():"#ffffff"};Q73.prototype.lineColor=function(){var a=this.chart.model();return a?a.model().properties().scalesProperties.lineColor.value():"#ffffff"};
|
|
Q73.prototype.textColor=function(){var a=this.chart.model();return a?a.model().properties().scalesProperties.textColor.value():"#ffffff"};Q73.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()};
|
|
Q73.prototype.mouseDownEvent=function(a){if(this._mousedown)return!0;this._mousedown=!0;var b=this.chart.model();b.timeScale().isEmpty()||($(this.jqCell).css("cursor",cursorCss("cursor_size_horizontal","15 15")),b.startScaleTime(a.localX))};Q73.prototype.mouseDownOutsideEvent=function(a){a=this.chart.model();!a.timeScale().isEmpty()&&this._mousedown&&(this._mousedown=!1,a.endScaleTime(),this.restoreDefaultCursor())};
|
|
Q73.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)}};Q73.prototype.mouseUpEvent=function(a){this._mousedown=!1;a=this.chart.model();a.timeScale().isEmpty()||(a.endScaleTime(),this.restoreDefaultCursor())};
|
|
Q73.prototype.contextMenuEvent=function(a,b){!this._disableContextMenu&&D76.enabled("scales_context_menu")&&this._createContextMenu().show(a)};
|
|
Q73.prototype._createContextMenu=function(){var a=this.chart;a.model().mainSeries().createSessStudy();a.updateActions();var a=a.actions(),b=D76.enabled("charting_library")?[a.timeScaleReset,new ActionSeparator,a.applyTimeZone,a.extendedHours]:[a.timeScaleReset,new ActionSeparator,a.applyTimeZone,a.sessionBreaks,a.extendedHours];b.push(new ActionSeparator,a.tmzProperties);return ContextMenu.createMenu(b)};Q73.prototype.mouseClickEvent=function(a){};
|
|
Q73.prototype.mouseDoubleClickEvent=function(a){TradingView.trackEvent("GUI","Double click time scale");this.chart.model().resetTimeScale()};Q73.prototype.optimalHeight=function(){return this.isVisible()?this.BORDER_SIZE+this.MAJOR_TICK_LENGTH+this.maxFontSize+6:0};Q73.prototype.setFont=function(a,b,c){this.baseFont=makeFont(a,b,c);this.baseBoldFont=makeFont(a,b,c+" bold ");this.labelFont=this.baseFont;this.maxFontSize=a};
|
|
Q73.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.jqCell.width(a.w),this.jqCell.height(a.h))};Q73.prototype._spanIndex=function(a){for(var b=[MINUTE_SPAN,HOUR_SPAN,DAY_SPAN,MONTH_SPAN,YEAR_SPAN],c=b.length-1;0<c&&!(b[c]<=a);)c--;return c};Q73.prototype._spanOffset=function(a,b){if(b<a)throw new Exception("actual span cuold not be less then base");return this._spanIndex(b)-this._spanIndex(a)};
|
|
Q73.prototype.update=function(){if(this.chart.model()){var a=this.chart.model().timeScale().marks();if(a){var b=this;this._minVisibleSpan=YEAR_SPAN;$.each(a,function(){b._minVisibleSpan=Math.min(this.span,b._minVisibleSpan)})}}};
|
|
Q73.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);clearRect(a,d,1,c-d,this.size.h-1,"rgba(109, 158, 235, 0.3)")};
|
|
Q73.prototype.drawBackground=function(a){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 D46&&!c.isEmpty()){c=d.points();if(0==c.size())return;this._hightlightBackground(a,c)}b=b.model().crossHairSource();b.startMeasurePoint()&&this._hightlightBackground(a,b.measurePoints())}};
|
|
Q73.prototype.drawBorder=function(a){a.save();a.fillStyle=this.lineColor();a.fillRect(-0.5,0.5,this.size.w+0.5,this.BORDER_SIZE);a.restore()};
|
|
Q73.prototype.drawStubs=function(){var a=this.BORDER_SIZE,b=2*this.BORDER_SIZE,c=this.lhsCtx;clearRect(c,0,0,this.lhsStubSize.w,this.lhsStubSize.h,this.backgroundColor());c.fillStyle=this.lineColor();c.fillRect(this.lhsStubSize.w-b-0.5,0.5,b,a);c.fillRect(this.lhsStubSize.w-b-0.5,-0.5,a,a);c=this.rhsCtx;clearRect(c,0,0,this.rhsStubSize.w,this.rhsStubSize.h,this.backgroundColor());c.fillStyle=this.lineColor();c.fillRect(-0.5,0.5,b,a);c.fillRect(0.5,-0.5,a,a)};
|
|
Q73.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(0.5,0.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(d=b.length;d--;)a.font=
|
|
b[d].span>=c?this.baseBoldFont:this.baseFont,a.fillText(b[d].label,b[d].coord,this.BORDER_SIZE+this.MAJOR_TICK_LENGTH-1);a.restore()}};
|
|
Q73.prototype.drawBackLabels=function(a){a.save();try{a.font=this.labelFont}catch(b){}for(var c=this.chart.model().Z18(),d=this.chart.model(),d=d.sourceBeingMoved()||d.lineBeingEdited()||d.lineBeingCreated(),e=0;e<c.size();e++){var f=c.item(e);if(f!==this.chart.model().crossHairSource()&&f!==d&&f.timeAxisViews&&(f=f.timeAxisViews()))for(var g=0;g<f.size();g++)f.item(g).renderer().draw(a,this.size.w,this.size.h)}a.restore()};
|
|
Q73.prototype.drawCrossHairLabel=function(a){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.size();c++)b.item(c).renderer().draw(a,this.size.w,this.size.h)}else{a.save();try{a.font=this.labelFont}catch(d){}if(b=this.chart.model().crossHairSource().timeAxisView())for(c=0;c<b.size();c++)b.item(c).renderer().draw(a,this.size.w,this.size.h)}a.restore()};
|
|
Q73.prototype.paint=function(a){try{this.top_ctx.font=this.labelFont}catch(b){}0!==a&&(a===Q22.UPDATE_CURSOR_ONLY?(this.top_ctx.clearRect(-0.5,-0.5,this.size.w,this.size.h),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))))};
|
|
Q73.prototype.setStubVisible=function(a,b){var c=Q54.isLeft(a)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;b?c.show():c.hide()};Q73.prototype.isVisible=function(){return this.jqRow.is(":visible")};Q73.prototype.setVisible=function(a){a?this.jqRow.show():this.jqRow.hide()};Q73.prototype.restoreDefaultCursor=function(){this.jqCell.css("cursor","default")};
|
|
Q73.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};function W41(a,b,c,d){Z6.call(this,a,b);this.Z0=c;this._showOnlyConfirmInputs=d;this.prepareLayout()}inherit(W41,Z6);
|
|
W41.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);editorIds=["start_hours","start_minutes","end_hours","end_minutes"];c.call(this,a,editorIds[0]);e.call(this,a,":",0);c.call(this,a,editorIds[1]);e.call(this,a,"-",4);c.call(this,a,editorIds[2]);e.call(this,a,":",0);c.call(this,a,editorIds[3]);this.bindControl(new Z7(a,editorIds,b,!1,this.model(),d))}};
|
|
W41.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">'),Q69.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 Z10(h,this._property.inputs[e],null,!0,this.model(),g)):"bar_time"===d.type?(this.bindControl(new Z8(h,
|
|
this._property.inputs[e],!0,this.model(),g,this.model().mainSeries(),10)),h.addClass("ticker")):"integer"===d.type?(k=[ToIntTransformer(d.defval)],(0===d.min||d.min)&&k.push(GreateTransformer(d.min)),(0===d.max||d.max)&&k.push(LessTransformer(d.max)),this.bindControl(new SimpleStringBinder(h,this._property.inputs[e],k,!1,this.model(),g)),h.addClass("ticker")):"float"===d.type?(k=[ToFloatTransformer(d.defval)],(0===d.min||d.min)&&k.push(GreateTransformer(d.min)),(0===d.max||d.max)&&k.push(LessTransformer(d.max)),
|
|
this.bindControl(new SimpleStringBinder(h,this._property.inputs[e],k,!1,this.model(),g)),h.addClass("ticker")):"text"===d.type?this.bindControl(new SimpleStringBinder(h,this._property.inputs[e],null,!1,this.model(),g)):"bool"===d.type?this.bindControl(new Z11(h,this._property.inputs[e],!0,this.model(),g)):"resolution"===d.type?this.bindControl(new Z10(h,this._property.inputs[e],UppercaseTransformer,!0,this.model(),"Change Interval")):"symbol"===d.type&&this.bindControl(new Z9(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=[ToIntTransformer(this._property.offset.val)],k.push(GreateTransformer(this._property.offset.min)),k.push(LessTransformer(this._property.offset.max)),this.bindControl(new 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=[ToIntTransformer(d.val)];g.push(GreateTransformer(d.min));g.push(LessTransformer(d.max));this.bindControl(new SimpleStringBinder(f,d.val,g,!1,this.model(),"Undo "+e))}}}.bind(this))};
|
|
W41.prototype.prepareLayout=function(){this._table=$("<table/>");this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");var a=this.Z0.metaInfo();this.prepareLayoutImpl(a,this._table);this.loadData()};W41.prototype.widget=function(){return this._table};function W47(a,b,c){Z6.call(this,a,b);this.Z0=c;this.prepareLayout()}inherit(W47,Z6);
|
|
W47.prototype.prepareLayout=function(){this._table=$("<table/>");this._table.addClass("property-page");this._table.attr("cellspacing","0");this._table.attr("cellpadding","2");for(var a=0;a<this.Z0.metaInfo().plots.length;++a)if(!this.Z0.isSelfColorerPlot(a)&&!this.Z0.isDataOffsetPlot(a)){var b=this.Z0.metaInfo().plots[a];this.Z0.isLinePlot(a)||this.Z0.isBarColorerPlot(a)||this.Z0.isBgColorerPlot(a)?this._prepareLayoutForPlot(a,b):this.Z0.isPlotArrowsPlot(a)?
|
|
this._prepareLayoutForArrowsPlot(a,b):this.Z0.isPlotCharsPlot(a)?this._prepareLayoutForCharsPlot(a,b):this.Z0.isPlotShapesPlot(a)?this._prepareLayoutForShapesPlot(a,b):console.error("Unknown plot type: "+b.type)}if(a=this.Z0.properties().transparency){var c=$('<tr class="line"/>');c.appendTo(this._table);$("<td/>").appendTo(c);b=$("<td/>");b.appendTo(c);b.addClass("propertypage-name-label");b.html($.t("Transparency"));b=$("<td/>");b.attr("colspan","3");b.appendTo(c);c=TradingView.createTransparencyEditor().width(270);
|
|
c.appendTo(b);this.bindControl(new SliderBinder(c,a,!0,this.model(),"Change Study Transparency"))}var d=this.Z0.properties().bands;if(d&&0<d.childCount())for(a=0;a<d.childCount();a++){b=d[a];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=b.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=[ToFloatTransformer(b.value.value())];c="Change band";this.bindControl(new SimpleStringBinder(l,b.value,k,!1,this.model(),c));this.bindControl(new Z11(f,b.visible,
|
|
!0,this.model(),c));this.bindControl(new ColorBinding(e,b.color,!0,this.model(),c));this.bindControl(new Z10(g,b.linestyle,parseInt,!0,this.model(),c));this.bindControl(new SliderBinder(h,b.linewidth,!0,this.model(),c))}this.Z0.properties().bandsBackground&&(b=this.Z0.properties().bandsBackground,f=$.t("Background"),c=this._prepareFilledAreaBackground(b.fillBackground,b.backgroundColor,b.transparency,f,"Change band background"),c.appendTo(this._table));this.Z0.properties().areaBackground&&
|
|
(b=this.Z0.properties().areaBackground,f=$.t("Background"),c=this._prepareFilledAreaBackground(b.fillBackground,b.backgroundColor,b.transparency,f,"Change area background"),c.appendTo(this._table));d=this.Z0.metaInfo().filledAreas;if(void 0!=d)for(a=0;a<d.length;++a)c=d[a],b=this.Z0.properties().filledAreasStyle[c.id],f=c.title||$.t("Background"),c="Change "+f,c=this._prepareFilledAreaBackground(b.visible,b.color,b.transparency,f,c),c.appendTo(this._table);for(var m in this.Z0.metaInfo().graphics){var a=
|
|
this.Z0.metaInfo().graphics[m],q;for(q in a)b=this._property.graphics[m][q],W47["_createRow_"+m].call(this,this._table,b)}1==this._table.find("tr").length&&(e=this._table.find(".visibility-cell"),e.css("display","none"),b=this._table.find(".propertypage-name-label"),b.css("padding-left",0));m=this._prepareStudyPropertiesLayout();this._table=this._table.add(m);this.loadData()};
|
|
W47.prototype._prepareLayoutForPlot=function(a,b){var c=b.id,d=this.Z0.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.Z0.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 q=TradingView.createTransparencyEditor(c);q.appendTo(m);l=d.plottype.value();m.css("display",this._isStyleNeedsTransparency(l)?"block":"none");l=$("<td>");l.appendTo(f);var n=$("<input type='checkbox'>");
|
|
n.appendTo(l);this.createLabeledCell("Price Line",n).appendTo(f);this.bindControl(new Z11(g,d.visible,!0,this.model(),e));this.bindControl(new ColorBinding(c,d.color,!0,this.model(),e));this.bindControl(new SliderBinder(h,d.linewidth,!0,this.model(),e));this.bindControl(new Z10(k,d.plottype,parseInt,!0,this.model(),e));this.bindControl(new SliderBinder(q,d.transparency,!0,this.model(),e));this.bindControl(new Z11(n,d.trackPrice,!0,this.model(),"Change Price Line"));
|
|
e=function(){var a=d.plottype.value();m.css("display",this._isStyleNeedsTransparency(a)?"table-cell":"none");q.css("display",this._isStyleNeedsTransparency(a)?"inline-block":"none")}.bind(this);e();d.plottype.listeners().subscribe(null,e)}};
|
|
W47.prototype._prepareLayoutForShapesPlot=function(a,b){var c=b.id,d=this.Z0.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 Z11(l,d.visible,!0,this.model(),e));c=this.Z0.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 Z10(l,d.plottype,null,!0,this.model(),e));c=$("<td/>");c.appendTo(h);h=TradingView.createShapeLocationEditor();h.appendTo(c);this.bindControl(new Z10(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 ColorBinding(g,d.color,!0,this.model(),e)),f=$("<td>"),f.appendTo(h),h=TradingView.createTransparencyEditor(g),h.appendTo(f),this.bindControl(new SliderBinder(h,d.transparency,!0,this.model(),e)))};
|
|
W47.prototype._prepareLayoutForCharsPlot=function(a,b){var c=b.id,d=this.Z0.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 Z11(l,d.visible,!0,this.model(),e));c=this.Z0.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 SimpleStringBinder(l,d["char"],null,!1,this.model(),e));c=$("<td/>");c.appendTo(h);h=TradingView.createShapeLocationEditor();h.appendTo(c);this.bindControl(new Z10(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 ColorBinding(g,d.color,!0,this.model(),e)),f=$("<td>"),f.appendTo(h),h=TradingView.createTransparencyEditor(g),h.appendTo(f),this.bindControl(new SliderBinder(h,d.transparency,!0,this.model(),e)))};
|
|
W47.prototype._isStyleNeedsTransparency=function(a){return 0<=[TradingView.Study.PLOT_AREA,TradingView.Study.PLOT_AREA_WITH_BREAKS,TradingView.Study.PLOT_COLUMNS].indexOf(a)};W47.prototype._isStyleNeedsConnectPoints=function(a){return 0<=[TradingView.Study.PLOT_CROSS,TradingView.Study.PLOT_CIRCLES].indexOf(a)};
|
|
W47.prototype._prepareLayoutForPalette=function(a,b,c,d,e){b=b.id;var f=this.Z0.properties().styles[b];b=0;for(var g in c.colors){var h=d.colors[g];c=$('<tr class="line"/>');c.appendTo(this._table);$("<td/>").appendTo(c);var k=$("<td/>");k.appendTo(c);k.addClass($.t("propertypage-name-label",{context:"css_class"}));k.html($.t(h.name.value()));k=$("<td/>");k.appendTo(c);k.addClass("colorpicker-cell");k=TradingView.addColorPicker(k);this.bindControl(new ColorBinding(k,h.color,
|
|
!0,this.model(),e));if(0===b&&(this.Z0.isBgColorerPlot(a)||this.Z0.isPlotCharsPlot(a)||this.Z0.isPlotShapesPlot(a))){var l=$("<td>");l.appendTo(c);var m=TradingView.createTransparencyEditor(k);m.appendTo(l);this.bindControl(new SliderBinder(m,f.transparency,!0,this.model(),e))}if(this.Z0.isLinePlot(a)){l=$("<td/>");l.appendTo(c);var q=TradingView.createLineWidthEditor();q.appendTo(l);this.bindControl(new SliderBinder(q,h.width,!0,this.model(),e));h=$("<td>");h.appendTo(c);0===b&&(l=
|
|
TradingView.createPlotEditor(),l.appendTo(h),this.bindControl(new Z10(l,f.plottype,parseInt,!0,this.model(),e)),l=$("<td>"),l.appendTo(c),m=TradingView.createTransparencyEditor(k),m.appendTo(l),this.bindControl(new SliderBinder(m,f.transparency,!0,this.model(),e)),h=function(){var a=f.plottype.value();m.css("display",this._isStyleNeedsTransparency(a)?"block":"none")}.bind(this),h(),f.plottype.listeners().subscribe(null,h),h=$("<input type='checkbox'>"),k=$('<td colspan="4">').css({whiteSpace:"nowrap"}),
|
|
l=$("<span>").html($.t("Price Line")),q=$("<span>"),q.append(h),k.append(q).append(l).appendTo(c),this.bindControl(new Z11(h,f.trackPrice,!0,this.model(),"Change Price Line")))}b++}};
|
|
W47.prototype._prepareLayoutForArrowsPlot=function(a,b){var c=b.id,d=this.Z0.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.Z0.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 Z11(h,d.visible,!0,this.model(),e));this.bindControl(new ColorBinding(c,d.colorup,!0,this.model(),e));this.bindControl(new ColorBinding(g,d.colordown,!0,this.model(),e));this.bindControl(new SliderBinder(f,d.transparency,!0,this.model(),
|
|
e))};W47.prototype._findPlotPalette=function(a,b){var c=b.id,d=null,e=null,f=this.Z0.metaInfo().plots;if(this.Z0.isBarColorerPlot(a)||this.Z0.isBgColorerPlot(a))d=this.Z0.metaInfo().palettes[b.palette],e=this.Z0.properties().palettes[b.palette];else for(var g=0;g<f.length;g++)if(this.Z0.isSelfColorerPlot(g)&&f[g].target===c){d=this.Z0.metaInfo().palettes[f[g].palette];e=this.Z0.properties().palettes[f[g].palette];break}return{palette:d,paletteProps:e}};
|
|
W47.prototype._prepareStudyPropertiesLayout=function(){var a=$('<table class="property-page study-properties" cellspacing="0" cellpadding="2">');if(!this.Z0.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 Z10(b,this.Z0.properties().precision,null,!0,this.model(),"Change Precision"))}"Compare@tv-basicstudies"==this.Z0.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 Z10(b,this.Z0.properties().minTick,null,!0,this.model(),"Change MinTick")));return a};W47.prototype.widget=function(){return this._table};
|
|
W47.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 Z11(h,a,!0,this.model(),e+" visibility"));this.bindControl(new ColorBinding(d,b,!0,this.model(),e+" color"));this.bindControl(new SliderBinder(k,c,!0,this.model(),e+" transparency"));return f};
|
|
function W39(a,b,c){Z6.call(this,a,b);this.Z0=c;this._property=a;var d=null;$.each(b.m_model.panes().toArray(),function(a,b){$.each(b.Z18().toArray(),function(a,e){if(e==c)return d=b,!1})});this._pane=d;this.prepareLayout()}inherit(W39,Z6);
|
|
W39.prototype.prepareLayout=function(){if(this.Z0.properties().linkedToSeries&&this.Z0.properties().linkedToSeries.value())this._table=$();else{var a=$('<table class="property-page" cellspacing="0" cellpadding="2">'),b=$('<input type="checkbox" class="visibility-switch">'),c=this.addLabeledRow(a,"Last Value on Price Scale",b);$("<td>").prependTo(c).append(b);this.bindControl(new Z11(b,this._property.showLastValue,!0,this.model(),"Change Last Value on Price Scale Visibility"));
|
|
"undefined"!==typeof this._property.showStudyArguments&&(b=$('<input type="checkbox" class="visibility-switch">'),c=this.addLabeledRow(a,"Arguments in Header",b),$("<td>").prependTo(c).append(b),this.bindControl(new Z11(b,this._property.showStudyArguments,!0,this.model(),"Change Arguments in Header Visibility")));c=this._prepareStudyAttachmentLayout();this._table=a=a.add(c)}};
|
|
W39.prototype._prepareStudyAttachmentLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="2">'),b;this._pane&&(this._pane.leftPriceScale().Z18().contains(this.Z0)?b="left":this._pane.rightPriceScale().Z18().contains(this.Z0)?b="right":this._pane.isOverlay(this.Z0)&&(b="none"));if(b){var c=this;b=this.createKeyCombo({left:$.t("Scale Left"),right:$.t("Scale Right"),none:$.t("Screen (No Scale)")}).val(b).change(function(){switch(this.value){case "left":c.D99.move(c.Z0,
|
|
c._pane,c._pane.leftPriceScale());break;case "right":c.D99.move(c.Z0,c._pane,c._pane.rightPriceScale());break;case "none":c.D99.move(c.Z0,c._pane,null)}});var d=this.addRow(a);$("<td>").appendTo(d).append(b)}return a};W39.prototype.widget=function(){return this._table};
|
|
W47._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 Z11(e,b.visible,!0,this.model(),"Change "+
|
|
d+" visibility"));this.bindControl(new ColorBinding(f,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new Z10(h,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new SliderBinder(g,b.width,!0,this.model(),"Change "+d+" width"))};
|
|
W47._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 Z11(e,b.visible,!0,this.model(),"Change "+
|
|
d+" visibility"));this.bindControl(new ColorBinding(f,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new Z10(h,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new SliderBinder(g,b.width,!0,this.model(),"Change "+d+" width"))};
|
|
W47._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 Z11(e,b.visible,!0,this.model(),"Change "+
|
|
d+" visibility"));this.bindControl(new ColorBinding(f,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new Z10(h,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new SliderBinder(g,b.width,!0,this.model(),"Change "+d+" width"))};
|
|
W47._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 Z11(e,b.visible,!0,this.model(),"Change "+d+" visibility"));this.bindControl(new ColorBinding(f,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new Z10(h,b.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new SliderBinder(g,b.width,!0,this.model(),"Change "+d+" width"));this.bindControl(new Z11(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 Z11(e,b.showText,!0,this.model(),"Change "+d+" show text")),e=TradingView.createTextPosEditor(),$("<td>").append(e.render()).appendTo(c),this.bindControl(new Z10(e,b.textPos,parseInt,!0,this.model(),"Change "+d+" text position")),e=this.createFontSizeEditor(),$('<td colspan="2">').append(e).appendTo(c),
|
|
this.bindControl(new Z10(e,b.fontSize,parseInt,!0,this.model(),"Change "+d+" font size")))};
|
|
W47._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 Z11(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=[ToIntTransformer(40)];
|
|
g.push(GreateTransformer(0));g.push(LessTransformer(100));this.bindControl(new 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 Z10(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 Z11(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 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 ColorBinding(e[k],b.colors[k],!0,this.model(),"Change "+d[k]+" color")),this.bindControl(new SliderBinder(f[k],b.transparencies[k],!0,this.model(),"Change "+d[k]+" transparency")))};
|
|
W47._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 Z11(d,b.visible,!0,this.model(),"Change "+e+" visibility"));this.bindControl(new ColorBinding(f,b.color,!0,this.model(),
|
|
"Change "+e+" color"));this.bindControl(new SliderBinder(g,b.transparency,!0,this.model(),"Change "+e+" transparency"))};
|
|
W47._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 ColorBinding(e,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new SliderBinder(f,b.transparency,!0,this.model(),"Change "+d+" transparency"))};
|
|
W47._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 ColorBinding(e,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new SliderBinder(f,b.transparency,!0,this.model(),"Change "+d+" transparency"))};
|
|
W47._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);$("<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 ColorBinding(e,b.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new ColorBinding(f,b.fontColor,!0,this.model(),"Change "+d+" text color"));this.bindControl(new Z10(h,b.fontSize,parseInt,!0,this.model(),"Change "+d+" font size"));this.bindControl(new Z10(g,
|
|
b.fontFamily,null,!0,this.model(),"Change "+d+" font"));this.bindControl(new Z11(k,b.fontBold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new Z11(l,b.fontItalic,!0,this.model(),"Change Text Font Italic"));this.bindControl(new SliderBinder(m,b.transparency,!0,this.model(),"Change "+d+" transparency"))};
|
|
W47._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 Z11(d,
|
|
b.visible,!0,this.model(),"Change "+e+" visibility"));this.bindControl(new ColorBinding(f,b.color,!0,this.model(),"Change "+e+" back color"));this.bindControl(new SliderBinder(g,b.transparency,!0,this.model(),"Change "+e+" transparency"));this.bindControl(new SimpleStringBinder(h,b.size,null,!1,this.model(),"Change size"))};function Q85(a,b,c){a=b.m_model.properties();Z6.call(this,a,b);var d=this._series=b.mainSeries();this._chart=b.m_model;this.D99=b;this.D98=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().toArray(),function(a,b){$.each(b.Z18().toArray(),function(a,c){if(c==d)return e=b,!1})});this._pane=e;this.prepareLayout();
|
|
this._themes=TradingView.getThemesList()||[]}inherit(Q85,Z6);inherit(Q85,SeriesStylePropertyPageMixin);Q85.prototype.setScalesOpenTab=function(){this.scalesColumnLeft.data("layout-tab-open",EditObjectDialog.TAB_OPEN_OVERRIDE)};Q85.prototype.setTmzOpenTab=function(){this.tmzSessTable.data("layout-tab-open",EditObjectDialog.TAB_OPEN_OVERRIDE)};
|
|
Q85.prototype.prepareLayout=function(){var a=this,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")),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),g=$('<div class="property-page-column-2">').data("layout-tab",$.t("Scales"));this.scalesColumnLeft=g;var h=$('<div class="property-page-column-2">').data("layout-tab",$.t("Scales")),k=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Timezone/Sessions"));this.tmzSessTable=k;var l=a._alertSettingsIsVisible()?"Events & Alerts":$.t("Events"),l=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",l);this.D98 instanceof TradingView.ESDStudyBase&&
|
|
l.data("layout-tab-open",EditObjectDialog.TAB_OPEN_OVERRIDE);var m=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),q=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),n=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales")),t=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Background")),u=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",
|
|
$.t("Drawings")),z=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),s=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Style")),A=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab",$.t("Scales"));this._prepareSeriesStyleLayout(b,c,d,this._seriesProperty);var B=$('<input type="checkbox">'),w=this.addLabeledRow(z,"Price Line",B);$("<td>").append(B).prependTo(w);var v=TradingView.createLineWidthEditor();
|
|
$("<td>").append(v).appendTo(w);var C=this.createSeriesMinTickEditor(),G=$("<tr>");G.appendTo(s);$("<td>"+$.t("Override Min Tick")+"</td>").appendTo(G);$("<td>").append(C).appendTo(G);this.bindControl(new Z10(C,this._seriesProperty.minTick,null,!0,this.model(),"Change MinTick"));!this._alertSettingsIsVisible()&&!TradingView.Z17("esdindicatorfeature")||D76.enabled("charting_library")||this.createEventsTable(l);this.bindControl(new Z11(B,this._seriesProperty.showPriceLine,
|
|
!0,this.model(),"Change Price Price Line"));this.bindControl(new SliderBinder(v,this._seriesProperty.priceLineWidth,!0,this.model(),"Change Price Line Width"));var B=$("<tr>").appendTo(t),C=$('<table class="property-page" cellspacing="0" cellpadding="2">').appendTo($("<td>").appendTo(B)),I=this.createColorPicker(),w=this.createColorPicker(),E=TradingView.createLineStyleEditor(),K=TradingView.createTransparencyEditor(w),D=TradingView.createLineWidthEditor(),F=this.createColorPicker(),P=TradingView.createLineStyleEditor(),
|
|
r=this.createColorPicker(),G=this.createColorPicker(),B=this.createColorPicker(),v=TradingView.createTransparencyEditor(B),R=this.addLabeledRow(C,"Background");$('<td colspan="4">').append(I).appendTo(R);this.bindControl(new ColorBinding(I,this._property.paneProperties.background,!0,this.model(),"Change Chart Background Color"));I=this.addLabeledRow(C,"Crosshair");$("<td>").append(w).appendTo(I);$("<td>").append(E.render()).appendTo(I);$("<td>").append(D).appendTo(I);$("<td>").append(K).appendTo(I);
|
|
this.bindControl(new ColorBinding(w,this._property.paneProperties.crossHairProperties.color,!0,this.model(),"Change Crosshair Color"));this.bindControl(new Z10(E,this._property.paneProperties.crossHairProperties.style,parseInt,!0,this.model(),"Change Crosshair Style"));this.bindControl(new SliderBinder(D,this._property.paneProperties.crossHairProperties.width,!0,this.model(),"Change Crosshair Width"));this.bindControl(new SliderBinder(K,this._property.paneProperties.crossHairProperties.transparency,
|
|
!0,this.model(),"Change Crosshair Transparency"));w=this.addLabeledRow(C,"Grid Lines");$("<td>").append(F).appendTo(w);$('<td colspan="3">').append(P.render()).appendTo(w);this.bindControl(new ColorBinding(F,this._property.paneProperties.gridProperties.color,!0,this.model(),"Change Grid Lines Color"));this.bindControl(new Z10(P,this._property.paneProperties.gridProperties.style,parseInt,!0,this.model(),"Change Grid Lines Style"));F=this.addLabeledRow(C,"Scales Text");$('<td colspan="4">').append(r).appendTo(F);
|
|
this.bindControl(new ColorBinding(r,this._property.scalesProperties.textColor,!0,this.model(),"Change Scales Text Color"));r=this.addLabeledRow(C,"Scales Lines");$('<td colspan="4">').append(G).appendTo(r);this.bindControl(new ColorBinding(G,this._property.scalesProperties.lineColor,!0,this.model(),"Change Scales Lines Color"));C=this.addLabeledRow(C,"Watermark");$("<td>").append(B).appendTo(C);$('<td colspan="3">').append(v).appendTo(C);this.bindControl(new ColorBinding(B,this._property.symbolWatermarkProperties.color,
|
|
!0,this.model(),"Change Symbol Watermark Color"));this.bindControl(new SliderBinder(v,this._property.symbolWatermarkProperties.transparency,!0,this.model(),"Change Symbol Watermark Transparency"));B=$('<input type="checkbox">');v=$('<input type="checkbox">');C=$('<input type="checkbox">');C.change(function(){this.checked&&setTimeout(function(){a.D99.m_model.Z19(new Q22(Q22.LIGHT_UPDATE))},0)});G=$('<input type="checkbox">');G.change(function(){this.checked&&
|
|
setTimeout(function(){a.D99.m_model.Z19(new Q22(Q22.LIGHT_UPDATE))},0)});var E=$("<input type='checkbox'>"),r=$("<input type='checkbox' />"),F=$("<input type='checkbox' />"),M=$(r).add(F).change(function(a){M.filter(":checked").size()||($(this).attr("checked",!0),a.stopImmediatePropagation())}),P=$("<input type='checkbox' />"),L;this._pane&&(this._pane.leftPriceScale().Z18().contains(this._series)?L="left":this._pane.rightPriceScale().Z18().contains(this._series)?
|
|
L="right":this._pane.isOverlay(this._series)&&(L="none"));L&&(w={left:$.t("Scale Left"),right:$.t("Scale Right")},a._pane.actionNoScaleIsEnabled(a._series)&&(w.none=$.t("Screen (No Scale)")),L=this.createKeyCombo(w).val(L).change(function(){switch(this.value){case "left":a.D99.move(a._series,a._pane,a._pane.leftPriceScale());break;case "right":a.D99.move(a._series,a._pane,a._pane.rightPriceScale());break;case "none":a.D99.move(a._series,a._pane,null)}}),w=this.addRow(n),$("<td>").appendTo(w).append(L));
|
|
this.bindControl(new Z11(E,this._seriesProperty.showCountdown,!0,this.model(),"Change Show Countdown"));w=this.addLabeledRow(m,"Auto Scale",C);$("<td>").append(C).prependTo(w);w=this.addLabeledRow(m,"Scale Series Only",G);$("<td>").append(G).prependTo(w);w=this.addLabeledRow(q,"Percentage",B);$("<td>").append(B).prependTo(w);w=this.addLabeledRow(q,"Log Scale",v);$("<td>").append(v).prependTo(w);w=this.addLabeledRow(m,"Show Left Axis",r);$("<td>").append(r).prependTo(w);w=this.addLabeledRow(m,
|
|
"Show Right Axis",F);$("<td>").append(F).prependTo(w);w=this.addLabeledRow(m,"Show Symbol Labels",P);$("<td>").append(P).prependTo(w);D76.enabled("countdown")&&(w=this.addLabeledRow(q,"Show Countdown",E),$("<td>").append(E).prependTo(w));w=$("<tr>").appendTo(k);L=$("<td>").appendTo(w);L=$('<table cellspacing="0" cellpadding="0">').appendTo(L);w=$(document.createElement("tr"));w.appendTo(L);L=$(document.createElement("td"));L.appendTo(w);L.text($.t("Time Zone"));L=$(document.createElement("td")).attr("colspan",
|
|
2);L.appendTo(w);for(var J,w="",E=0;E<TradingView.availableTimezones.length;E++)w+='<option value="'+TradingView.availableTimezones[E].id+'">'+TradingView.availableTimezones[E].title+"</option>";w=$("<select>"+w+"</select>").change(function(){var b=$(this).val();J||(J=setTimeout(function(){a._chart._chartApi.switchTimezone(b);J=!1},300))});w.appendTo(L);this.bindControl(new Z10(w,this._property.timezone,null,!0,this.model(),"Change Timezone"));D76.enabled("charting_library")||
|
|
(this._series.createSessStudy(),this.createSessTable(k));if(D76.enabled("trading_options"))var N=this.createTradingTable();L=$('<input type="checkbox">');w=this.addLabeledRow(q,"Last Value on Price Scale",L);$("<td>").append(L).prependTo(w);var E=$("<input type='checkbox'/>"),T=this.addLabeledRow(q,"Lock scale",E);$("<td>").append(E).prependTo(T);this._seriesProperty.style.listeners().subscribe(this,function(a){T.toggle(a.value()==TradingView.Series.STYLE_PNF)});K=$('<input type="text" class="ticker">');
|
|
w=this.addLabeledRow(A,"Top Margin",K);$("<td>").appendTo(w).append(K);$("<td>%</td>").appendTo(w);w=[ToIntTransformer(this._property.paneProperties.topMargin.value())];w.push(LessTransformer(25));w.push(GreateTransformer(0));this.bindControl(new SimpleStringBinder(K,this._property.paneProperties.topMargin,w,!0,this.model(),"Top Margin"));K=$('<input type="text" class="ticker">');w=this.addLabeledRow(A,"Bottom Margin",K);$("<td>").appendTo(w).append(K);$("<td>%</td>").appendTo(w);w=[ToIntTransformer(this._property.paneProperties.bottomMargin.value())];
|
|
w.push(LessTransformer(25));w.push(GreateTransformer(0));this.bindControl(new SimpleStringBinder(K,this._property.paneProperties.bottomMargin,w,!0,this.model(),"Bottom Margin"));K=$('<input type="text" class="ticker">');w=this.addLabeledRow(A,"Right Margin",K);$("<td>").appendTo(w).append(K);$("<td>"+$.t("bars",{context:"margin"})+"</td>").appendTo(w);w=[ToIntTransformer(this._property.timeScale.rightOffset.value())];w.push(LessTransformer(~~this._chart.m_timeScale.maxOffset()));w.push(GreateTransformer(-200));
|
|
this.bindControl(new SimpleStringBinder(K,this._property.timeScale.rightOffset,w,!0,this.model(),"Right Margin"));this.bindControl(new Z11(r,this._property.scalesProperties.showLeftScale,!0,this.model(),"Show Left Axis"));this.bindControl(new Z11(F,this._property.scalesProperties.showRightScale,!0,this.model(),"Show Right Axis"));this.bindControl(new Z11(P,this._scaleProperty.showSymbolLabels,!0,this.model(),"Show Symbol Labels"));this.bindControl(new Z11(C,
|
|
this._scaleProperty.autoScale,!0,this.model(),"Auto Scale",function(b){this._undoModel.setAutoScaleProperty(this._property,b,a._series.priceScale(),this._undoText)}));this.bindControl(new DisabledBinder(C,this._scaleProperty.autoScaleDisabled,!0,this.model(),"Auto Scale"));this.bindControl(new Z11(G,this._property.scalesProperties.scaleSeriesOnly,!0,this.model(),"Scale Series Only"));this.bindControl(new Z11(B,this._mainAxisProperty.percentage,!0,this.model(),"Scale Percentage",
|
|
function(b){this._undoModel.setPercentProperty(this._property,b,a._series.priceScale(),this._undoText)}));this.bindControl(new DisabledBinder(B,this._mainAxisProperty.percentageDisabled,!0,this.model(),"Scale Percentage"));this.bindControl(new Z11(v,this._mainAxisProperty.log,!0,this.model(),"Log Scale",function(b){this._undoModel.setLogProperty(this._property,b,a._series.priceScale(),this._undoText)}));this.bindControl(new DisabledBinder(v,this._mainAxisProperty.logDisabled,!0,this.model(),
|
|
"Log Scale"));this.bindControl(new Z11(L,this._seriesProperty.showLastValue,!0,this.model(),"Change Last Value on Price Scale Visibility"));this.bindControl(new Z11(E,this._seriesProperty.lockScale,!0,this.model(),"Change lock scale",function(b){this._undoModel.setLockScaleProperty(this._property,b,a._series,this._undoText)}));this._table=b.add(c).add(d).add(e).add(f).add(z).add(s).add(t).add(g).add(h).add(u).add(k);D76.enabled("trading_options")&&(this._table=this._table.add(N));
|
|
this._table=this._table.add(l);h.append(n);h.append(m);g.append(q);g.append(A);this.loadData()};Q85.prototype.widget=function(){return this._table};Q85.prototype.loadData=function(){this.superclass.prototype.loadData.call(this);this.switchStyle()};Q85.prototype.loadTheme=function(a){var b=this;$.get("/theme/?themeName="+encodeURIComponent(a),function(c){b.D99._lastLoadedTheme=a;b.applyTheme(JSON.parse(c.content))})};
|
|
Q85.prototype.applyTheme=function(a){var b=this._seriesProperty.extendedHours.value();this.D99.model().restoreTheme(a);this._seriesProperty.extendedHours.value()!==b&&this._seriesProperty.extendedHours.listeners().fire(this._seriesProperty.extendedHours);this.loadData()};
|
|
Q85.prototype.createTemplateButton=function(a){if(D76.enabled("charting_library"))return $("<span />");var b=this;a||(a={});var c=function(){var c=[];c.push({title:"Save As...",action:function(){runOrSignIn(function(){TradingView.showChartNameDialog(function(a){if(a){var c={name:a,content:JSON.stringify(b.D99.model().theme())};$.post("/save-theme/",c).error(function(a){document.write(a.responseText)});b._themes.push(a);b.D99._lastLoadedTheme=a}},"Save theme as...",
|
|
"Theme name")},!0)},addClass:"special"});"function"===typeof a.defaultsCallback&&c.push({title:"Apply Defaults",action:a.defaultsCallback,addClass:"special"});var d=[];$.each(b._themes,function(a,c){d.push({title:c,action:function(){b.loadTheme(c)},deleteAction:is_authenticated?function(){var a=this;Q83.showConfirm("Theme","Do you realy want to delete "+(c?'"'+c+'"':"")+" theme?",function(){a instanceof $&&a.remove();$.post("/remove-theme/",{name:c}).error(function(a){document.write(a.responseText)});
|
|
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">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")||(a.trigger("button-popup",[c()]),
|
|
TradingView.getThemesList(function(d){b._themes=d;a.is(".active")&&a.trigger("button-popup",[c(),!0])}))});return d};
|
|
Q85.prototype.switchStyle=function(){toggledTbodies=$(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");switch(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")}};
|
|
Q85.prototype.onResoreDefaults=function(){var a=this.D99.model().properties().paneProperties.topMargin,b=this.D99.model().properties().paneProperties.bottomMargin;a.listeners().fire(a);b.listeners().fire(b)};
|
|
Q85.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 W51("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]};Q85.prototype._alertSettingsIsVisible=function(){return TradingView.Z17("alerts")&&!TradingView.onWidget()&&!TradingView.isRunningChartingLibrary};
|
|
Q85.prototype.createEventsTable=function(a){if(TradingView.Z17("esdindicatorfeature")){var b=$("<tr>").appendTo(a),c=$('<input type="checkbox" />'),d=this.addLabeledRow(b,"Show Dividends on Chart",c);$("<td>").append(c).prependTo(d);d.append("<td>");var e=this._seriesProperty.esdShowDividends;this.bindControl(new Z11(c,this._seriesProperty.esdShowDividends,!0,this.model(),"Change Show or Hide Dividends",function(a){this.D99.beginUndoMacro("Show Dividends");
|
|
this.D99.setProperty(e,a,"Show Dividends");this.D99.endUndoMacro()}.bind(this)));c=$('<input type="checkbox" />');d=this.addLabeledRow(b,"Show Splits on Chart",c);$("<td>").append(c).prependTo(d);d.append("<td>");var f=this._seriesProperty.esdShowSplits;this.bindControl(new Z11(c,this._seriesProperty.esdShowSplits,!0,this.model(),"Change Show or Hide Splits",function(a){this.D99.beginUndoMacro("Show Splits");this.D99.setProperty(f,a,"Show Splits");this.D99.endUndoMacro()}.bind(this)));
|
|
c=$('<input type="checkbox" />');d=this.addLabeledRow(b,"Show Earnings on Chart",c);$("<td>").append(c).prependTo(d);d.append("<td>");var g=this._seriesProperty.esdShowEarnings;this.bindControl(new Z11(c,this._seriesProperty.esdShowEarnings,!0,this.model(),"Change Show or Hide Earnings",function(a){this.D99.beginUndoMacro("Show Earnings");this.D99.setProperty(g,a,"Show Earnings");this.D99.endUndoMacro()}.bind(this)));var d=this.createTableInTable(a),h=$('<input type="checkbox" />'),
|
|
b=TradingView.createLineStyleEditor(),c=TradingView.addColorPicker(),k=TradingView.createLineWidthEditor(),d=this.addLabeledRow(d,"Earnings breaks",h);$("<td>").append(h).prependTo(d);$("<td>").append(c).appendTo(d);$("<td>").append(b.render()).appendTo(d);$("<td>").append(k).appendTo(d);d.addClass("offset-row");d.append("<td>");this.bindControl(new Z11(h,this._seriesProperty.esdShowBreaks,!0,this.model(),"Change Show or Hide Earnings"));this.bindControl(new ColorBinding(c,this._seriesProperty.esdBreaksStyle.color,
|
|
!0,this.model(),"Change earnings color"));this.bindControl(new Z10(b,this._seriesProperty.esdBreaksStyle.style,parseInt,!0,this.model(),"Change style"));this.bindControl(new SliderBinder(k,this._seriesProperty.esdBreaksStyle.width,!0,this.model(),"Change width"));this._seriesProperty.esdShowEarnings.listeners().subscribe(this,function(a){h.prop("disabled",!a.value())})}if(this._alertSettingsIsVisible()){d=$("<tr>").appendTo(a);b=$('<input type="checkbox" />');d=this.addLabeledRow(d,
|
|
"Show Alert Labels",b);$("<td>").append(b).prependTo(d);d.append("<td>");var l=this._property.alertsProperties.labels.visible;this.bindControl(new Z11(b,l,!0,this.model(),"Change Show or Hide Alert Labels",function(a){this.D99.beginUndoMacro("Show Alert Labels");this.D99.setProperty(l,a,"Show Alert Labels");this.D99.endUndoMacro()}.bind(this)));var d=this.createTableInTable(a),m=$('<input type="checkbox">');a=TradingView.addColorPicker();var q=TradingView.createLineWidthEditor(),
|
|
b=TradingView.createLineStyleEditor(),n=b.render(),d=this.addLabeledRow(d,"Extended Alert Line",m);$("<td>").append(m).prependTo(d);$("<td>").append(a).appendTo(d);$("<td>").append(n).appendTo(d);$("<td>").append(q).appendTo(d);d.addClass("offset-row");d.append("<td>");this.bindControl(new Z11(m,this._property.alertsProperties.labels.line.visible,!0,this.model(),"Change Show or Hide Alert Labels Lines"));this.bindControl(new ColorBinding(a,this._property.alertsProperties.labels.color,!0,
|
|
this.model(),"Change Alerts Labels color"));this.bindControl(new Z10(b,this._property.alertsProperties.labels.line.style,parseInt,!0,this.model(),"Change style"));this.bindControl(new SliderBinder(q,this._property.alertsProperties.labels.line.width,!0,this.model(),"Change width"));l.listeners().subscribe(this,function(a){m.prop("disabled",!a.value());n.prop("disabled",!a.value());q.prop("disabled",!a.value())})}};
|
|
Q85.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,"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 Z11(e,
|
|
b.graphics.vertlines.sessBreaks.visible,!0,this.model(),"Change "+d+" visibility"));this.bindControl(new ColorBinding(g,b.graphics.vertlines.sessBreaks.color,!0,this.model(),"Change "+d+" color"));this.bindControl(new Z10(f,b.graphics.vertlines.sessBreaks.style,parseInt,!0,this.model(),"Change "+d+" style"));this.bindControl(new 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,"Extended Hours (Intraday Only)",d);$("<td>").append(d).prependTo(c);this.bindControl(new Z14(d,this._seriesProperty.extendedHours,this._seriesProperty.interval,!0,this.model(),"Change Extended Hours"));this._seriesProperty.sessVis=b.graphics.vertlines.sessBreaks.visible;var c=this.createTableInTable(a),k=this._createStudySessRow(c,"Extended Hours",b.graphics.backgrounds.outOfSession),l=this._createStudySessRow(c,"In Session",b.graphics.backgrounds.inSession);
|
|
this._seriesProperty.extendedHours.listeners().subscribe(this,function(a){k.prop("disabled",!a.value());l.prop("disabled",!a.value())});a=this._series.isIntradayInterval();b=!a||!this._seriesProperty.extendedHours.value();e.prop("disabled",!a);d.prop("disabled",!a);k.prop("disabled",b);l.prop("disabled",b);return c};
|
|
Q85.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 Z11(d,c.visible,!0,this.model(),"Change "+b+" visibility"));this.bindControl(new ColorBinding(e,c.color,!0,this.model(),b+" color"));this.bindControl(new 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};
|
|
Q85.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 Z11(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 Z11(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 Z11(b,this._property.tradingProperties.extendLeft,!0,this.model(),"Extend Lines Left"));b=TradingView.createLineWidthEditor();
|
|
this.bindControl(new SliderBinder(b,this._property.tradingProperties.lineWidth,!0,this.model(),"Change Connecting Line Width"));d=TradingView.createLineStyleEditor();this.bindControl(new Z10(d,this._property.tradingProperties.lineStyle,parseInt,!0,this.model(),"Change Connecting Line Style"));var e=$('<input type="text" class="ticker">'),f=[ToIntTransformer(this._property.tradingProperties.lineLength.value()),LessTransformer(100),GreateTransformer(0)];this.bindControl(new 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">');c=this.addLabeledRow(c,$.t("Show Executions"),b);$("<td>").append(b).prependTo(c);this.bindControl(new Z11(b,this._property.tradingProperties.showExecutions,
|
|
!0,this.model(),"Change Executions Visibility"));return a};function W38(a,b){Z6.call(this,a,b);this.prepareLayout()}inherit(W38,Z6);
|
|
W38.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 Z10(a,this._property.inputs.source,null,!0,this.model(),
|
|
"Change Price Source"));this.loadData()};W38.prototype.widget=function(){return this._table};function W14(a,b,c){Z6.call(this,a,b);this._linetool=c;this.prepareLayout()}inherit(W14,Z6);
|
|
W14.prototype._createPointRow=function(a,b,c){a=$("<tr>");var d=$("<td>");d.html($.t("Price")+c);d.appendTo(a);d=$("<td>");d.appendTo(a);c=$("<input type='text'>");c.appendTo(d);d=$("<td>");d.html($.t("Bar #"));d.appendTo(a);barEditCell=$("<td>");barEditCell.appendTo(a);d=$("<input type='text'>");d.appendTo(barEditCell);d.addClass("ticker");var e=[ToFloatTransformer(b.price.value())];this.bindControl(new SimpleStringBinder(c,b.price,e,!1,this.model(),"Change "+this._linetool+
|
|
" point price"));e=[ToIntTransformer(b.bar.value()),GreateTransformer(-5E4),LessTransformer(15E3)];this.bindControl(new SimpleStringBinder(d,b.bar,e,!1,this.model(),"Change "+this._linetool+" point bar index"));return a};
|
|
W14.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()};W14.prototype.widget=function(){return this._table};function Q91(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q91,W49);
|
|
Q91.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("Bars")+'</option><option value="1">'+$.t("Line")+"</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 Z11(e,this._linetool.properties().mirrored,!0,this.model(),"Change Bars Pattern Mirroring"));this.bindControl(new Z11(a,this._linetool.properties().flipped,!0,
|
|
this.model(),"Change Bars Pattern Flipping"));this.bindControl(new ColorBinding(b,this._linetool.properties().color,!0,this.model(),"Change Bars Pattern Color"));this.bindControl(new Z10(d,this._linetool.properties().mode,null,!0,this.model(),"Change Bars Pattern Mode"));this.loadData()};Q91.prototype.widget=function(){return this._table};function Q90(a,b,c){W14.call(this,a,b,c)}
|
|
inherit(Q90,W14);
|
|
Q90.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);barEditCell=$("<td>");barEditCell.appendTo(a);
|
|
a=$("<input type='text'>");a.appendTo(barEditCell);a.addClass("ticker");var c=this._linetool.properties().points[0],d=[ToFloatTransformer(c.price.value())];this.bindControl(new SimpleStringBinder(b,c.price,d,!1,this.model(),"Change "+this._linetool+" point price"));d=[ToIntTransformer(c.bar.value()),GreateTransformer(-5E3),LessTransformer(15E3)];this.bindControl(new SimpleStringBinder(a,c.bar,d,!1,this.model(),"Change "+this._linetool+" point bar index"));this.loadData()};function Q93(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q93,W49);
|
|
Q93.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 ColorBinding(a,this._linetool.properties().color,!0,this.model(),"Change Text Color"));this.bindControl(new Z10(b,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new Z10(c,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new SimpleStringBinder(d,this._linetool.properties().text,null,!0,this.model(),"Change Text"));this.bindControl(new ColorBinding(e,
|
|
this._linetool.properties().backgroundColor,!0,this.model(),"Change Text Background"));this.bindControl(new SliderBinder(f,this._linetool.properties().transparency,!0,this.model(),"Change Text Background Transparency"));this.bindControl(new ColorBinding(h,this._linetool.properties().bordercolor,!0,this.model(),"Change Text Color"));this.bindControl(new SliderBinder(g,this._linetool.properties().linewidth,!0,this.model(),"Change Border Width"));this.bindControl(new Z11(k,this._linetool.properties().wordWrap,
|
|
!0,this.model(),"Change Text Wrap"));this.bindControl(new Z11(l,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new Z11(m,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));var q=$('<table class="property-page" cellspacing="0" cellpadding="2">').data("layout-tab-open",EditObjectDialog.TAB_OPEN_OVERRIDE),n=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$('<table class="property-page" cellspacing="0" cellpadding="2">');
|
|
this._table=q.add(t).add(n);$(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(q);$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(d)).appendTo(q);a=this.addLabeledRow(n,
|
|
"Text Wrap",k);$("<td>").append(k).prependTo(a);a=this.addLabeledRow(t,"Background");$("<td>").append(e).appendTo(a);$("<td>").append(f).appendTo(a);a=this.addLabeledRow(t,"Border");$("<td>").append(h).appendTo(a);$("<td>").append(g).appendTo(a);this.loadData();setTimeout(function(){d.select();d.focus()},20)};Q93.prototype.widget=function(){return this._table};function W32(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W32,W49);
|
|
W32.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 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">'),q=$('<input type="checkbox">'),n=$('<input type="checkbox">'),t=$('<input type="checkbox">'),
|
|
u=$('<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(q);a=this.addLabeledRow(e,$.t("Show Distance"));$('<td colspan="3">').appendTo(a).append(n);a=this.addLabeledRow(e,$.t("Show Angle"));$('<td colspan="3">').appendTo(a).append(t);a=this.addLabeledRow(e,
|
|
$.t("Always Show Stats"));$('<td colspan="3">').appendTo(a).append(u);this.bindControl(new Z11(g,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Trend Line Extending Left")));this.bindControl(new Z11(k,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Trend Line Extending Right")));this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Trend Line Color")));this.bindControl(new Z10(c,
|
|
this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Trend Line Style")));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Trend Line Width")));this.bindControl(new Z10(l,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Trend Line Left End")));this.bindControl(new Z10(m,this._linetool.properties().rightEnd,parseInt,!0,this.model(),$.t("Change Trend Line Right End")));this.bindControl(new Z11(f,
|
|
this._linetool.properties().showPriceRange,!0,this.model(),$.t("Change Trend Line Show Price Range")));this.bindControl(new Z11(h,this._linetool.properties().showBarsRange,!0,this.model(),$.t("Change Trend Line Show Bars Range")));this.bindControl(new Z11(q,this._linetool.properties().showDateTimeRange,!0,this.model(),$.t("Change Trend Line Show Date/Time Range")));this.bindControl(new Z11(n,this._linetool.properties().showDistance,!0,this.model(),"Change Trend Line Show Distance"));
|
|
this.bindControl(new Z11(t,this._linetool.properties().showAngle,!0,this.model(),$.t("Change Trend Line Show Angle")));this.bindControl(new Z11(u,this._linetool.properties().alwaysShowStats,!0,this.model(),$.t("Change Trend Line Always Show Stats")));this.loadData()};W32.prototype.widget=function(){return this._table};function W12(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W12,W49);
|
|
W12.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 q=$("<select><option value='left'>"+$.t("left")+"</option><option value='center'>"+$.t("center")+"</option><option value='right'>"+$.t("right")+
|
|
"</option></select>"),n=$("<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(q).appendTo(d);$("<td colspan='3'>").append(n).appendTo(d);var t=$("<textarea rows='7' cols='60'>").css("width","100%"),d=$("<tr>").appendTo(this._table);$("<td colspan='7'>").append(t).appendTo(d);this.bindControl(new Z11(f,this._linetool.properties().showLabel,
|
|
!0,this.model(),"Change Horz Line Text Visibility"));this.bindControl(new Z10(q,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Horz Line Labels Alignment"));this.bindControl(new Z10(n,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Horz Line Labels Alignment"));this.bindControl(new SimpleStringBinder(t,this._linetool.properties().text,null,!0,this.model(),"Change Text"));this.bindControl(new Z11(e,this._linetool.properties().showPrice,
|
|
!0,this.model(),"Change Horz Line Price Visibility"));this.bindControl(new ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Horz Line Color"));this.bindControl(new Z10(b,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Horz Line Style"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Horz Line Width"));this.bindControl(new Z10(h,this._linetool.properties().fontsize,parseInt,
|
|
!0,this.model(),"Change Text Font Size"));this.bindControl(new Z10(k,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new ColorBinding(g,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color"));this.bindControl(new Z11(l,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new Z11(m,this._linetool.properties().italic,!0,this.model(),"Change Text Font Italic"));this.loadData()};
|
|
W12.prototype.widget=function(){return this._res};function W11(a,b,c){W14.call(this,a,b,c)}inherit(W11,W14);
|
|
W11.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');if(this._linetool.points().item(0)){var a=$('<input type="text">'),b=$("<tr>").appendTo(this._table);$("<td>"+$.t("Price")+"</td>").appendTo(b);$("<td>").append(a).appendTo(b);var b=this._linetool.properties().points[0],c=[ToFloatTransformer(b.price.value())];this.bindControl(new SimpleStringBinder(a,b.price,c,!1,this.model(),"Change "+this._linetool+
|
|
" point price"));this.loadData()}};function W36(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W36,W49);
|
|
W36.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 Z11(e,this._linetool.properties().showTime,!0,this.model(),"Change Vert Line Time Visibility"));this.bindControl(new ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Vert Line Color"));this.bindControl(new Z10(b,this._linetool.properties().linestyle,
|
|
parseInt,!0,this.model(),"Change Vert Line Style"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Vert Line Width"));this.loadData()};W36.prototype.widget=function(){return this._table};function W35(a,b,c){W14.call(this,a,b,c)}inherit(W35,W14);
|
|
W35.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=[ToIntTransformer(b.bar.value()),GreateTransformer(-5E3),LessTransformer(15E3)];this.bindControl(new SimpleStringBinder(a,
|
|
b.bar,c,!1,this.model(),"Change "+this._linetool+" point bar index"));this.loadData()}};function W18(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W18,W49);W18.prototype.onResoreDefaults=function(){this._linetool.properties().style.listeners().fire(this._linetool.properties().style)};
|
|
W18.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 Z11(a,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new SimpleStringBinder(e,b.coeff,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 ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new Z10(c,
|
|
b.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style"));this.bindControl(new SliderBinder(d,b.linewidth,!0,this.model(),"Change Pitchfork Line Width"))};
|
|
W18.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 Z10(d,
|
|
this._linetool.properties().style,parseInt,!0,this.model(),"Change Pitchfork Style"));this.bindControl(new Z11(b,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfork Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfork Background Transparency"));this.loadData()};W18.prototype.widget=function(){return this._table};function W17(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W17,W49);
|
|
W17.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 Z11(a,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new SimpleStringBinder(e,b.coeff,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 ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new Z10(c,b.linestyle,parseInt,
|
|
!0,this.model(),"Change Pitchfan Line Style"));this.bindControl(new SliderBinder(d,b.linewidth,!0,this.model(),"Change Pitchfan Line Width"))};
|
|
W17.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 Z11(b,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfan Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfan Background Transparency"));this.loadData()};W17.prototype.widget=function(){return this._table};function LineToolTextInplaceEditor(a,b){this.Z3=a;this._undoModel=b}
|
|
LineToolTextInplaceEditor.prototype.attachSource=function(a,b){this.D98=a;this._edit=$("<textarea>");this._edit.css("width","300");this._edit.css("height","150");this._edit.appendTo(this.Z3._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 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};function W27(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W27,W49);
|
|
W27.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>'),
|
|
q=$('<span class="tv-button tv-button-fontstyle"><span class="icon-fontstyle-italic"></span></span>');this.bindControl(new ColorBinding(a,this._linetool.properties().color,!0,this.model(),$.t("Change Text Color")));this.bindControl(new Z10(c,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new Z10(d,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new SimpleStringBinder(e,
|
|
this._linetool.properties().text,null,!0,this.model(),$.t("Change Text")));this.bindControl(new ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Text Background")));this.bindControl(new SliderBinder(g,this._linetool.properties().backgroundTransparency,!0,this.model(),$.t("Change Text Background Transparency")));this.bindControl(new Z11(h,this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Text Background Fill")));this.bindControl(new Z11(k,
|
|
this._linetool.properties().drawBorder,!0,this.model(),$.t("Change Text Border")));this.bindControl(new ColorBinding(b,this._linetool.properties().borderColor,!0,this.model(),$.t("Change Text Border Color")));this.bindControl(new Z11(l,this._linetool.properties().wordWrap,!0,this.model(),$.t("Change Text Wrap")));this.bindControl(new Z11(m,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new Z11(q,this._linetool.properties().italic,
|
|
!0,this.model(),$.t("Change Text Font Italic")));var n=$('<table class="property-page" cellspacing="0" cellpadding="2">'),t=$('<table class="property-page" cellspacing="0" cellpadding="2">'),u=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=n.add(u).add(t);$(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(q)).appendTo(n);
|
|
$(document.createElement("tr")).append($(document.createElement("td")).attr({colspan:5}).append(e)).appendTo(n);a=this.addLabeledRow(t,$.t("Text Wrap"),l);$("<td>").append(l).prependTo(a);a=this.addLabeledRow(u,$.t("Background"),h);$("<td>").append(h).prependTo(a);$("<td>").append(f).appendTo(a);$("<td>").append(g).appendTo(a);a=this.addLabeledRow(u,$.t("Border"),k);$("<td>").append(k).prependTo(a);$("<td>").append(b).appendTo(a);this.loadData();setTimeout(function(){e.select();e.focus()},20)};
|
|
W27.prototype.widget=function(){return this._table};
|
|
W27.prototype.dialogPosition=function(a,b){var c=0,d=this._linetool,e=d.D99.paneForSource(d);$.each(this.D99.Z3._paneWidgets,function(a,b){if(b._state==e)return c=$(b.canvas).offset().top,!1});a||(a={});var f=a.left,g=a.top,h=this._linetool.paneViews().item(0);if(h)var k=h._floatPoints.item(0);k&&(f=k.x,g=k.y+c);h=$(b).outerHeight();k=$(window).height();d=d.properties().fontsize.value();return{top:g+h+d+5<=k?g+d+5:g-h-5,left:f}};function W23(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W23,W49);
|
|
W23.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 Z11(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Rectangle Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,
|
|
!0,this.model(),"Change Rectangle Line Color"));this.bindControl(new ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Rectangle Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Rectangle Border Width"));this.bindControl(new SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Rectangle Background Transparency"));this.loadData()};
|
|
W23.prototype.widget=function(){return this._table};function Q98(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q98,W49);
|
|
Q98.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 Z11(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Ellipse Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,
|
|
!0,this.model(),"Change Ellipse Line Color"));this.bindControl(new ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Ellipse Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Ellipse Border Width"));this.bindControl(new SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Ellipse Background Transparency"));this.loadData()};
|
|
Q98.prototype.widget=function(){return this._table};function Q87(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q87,W49);
|
|
Q87.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 Z11(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Arc Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,
|
|
!0,this.model(),"Change Arc Line Color"));this.bindControl(new ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Arc Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Arc Border Width"));this.bindControl(new SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Arc Background Transparency"));this.loadData()};Q87.prototype.widget=function(){return this._table};function W34(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W34,W49);
|
|
W34.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 Z11(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Triangle Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,
|
|
!0,this.model(),"Change Triangle Line Color"));this.bindControl(new ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Triangle Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Triangle Border Width"));this.bindControl(new SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Triangle Background Transparency"));this.loadData()};
|
|
W34.prototype.widget=function(){return this._table};function W16(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W16,W49);
|
|
W16.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 q=$("<tbody>").appendTo(this._table),e=this.addEditorRow(q,"Extend Left",$("<input type='checkbox'>"),2),q=this.addEditorRow(q,"Extend Right",$("<input type='checkbox'>"),2),n=this._linetool.properties();this.bindControl(new Z11(a,n.fillBackground,!0,this.model(),"Change Parallel Channel Fill Background"));
|
|
this.bindControl(new Z11(g,n.showMidline,!0,this.model(),"Change Parallel Channel Show Center Line"));this.bindControl(new Z11(e,n.extendLeft,!0,this.model(),"Change Parallel Channel Extending Left"));this.bindControl(new Z11(q,n.extendRight,!0,this.model(),"Change Parallel Channel Extending Right"));this.bindControl(new ColorBinding(d,n.linecolor,!0,this.model(),"Change Parallel Channel Color"));this.bindControl(new Z10(c,n.linestyle,parseInt,!0,this.model(),
|
|
"Change Parallel Channel Style"));this.bindControl(new SliderBinder(b,n.linewidth,!0,this.model(),"Change Parallel Channel Width"));this.bindControl(new ColorBinding(k,n.midlinecolor,!0,this.model(),"Change Parallel Channel Middle Color"));this.bindControl(new Z10(h,n.midlinestyle,parseInt,!0,this.model(),"Change Parallel Channel Middle Style"));this.bindControl(new SliderBinder(f,n.midlinewidth,!0,this.model(),"Change Parallel Channel Middle Width"));this.bindControl(new ColorBinding(l,
|
|
n.backgroundColor,!0,this.model(),"Change Parallel Channel Back Color"));this.bindControl(new SliderBinder(m,n.transparency,!0,this.model(),"Change Parallel Channel Background Transparency"));this.loadData()};W16.prototype.widget=function(){return this._table};function Q88(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q88,W49);
|
|
Q88.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 ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Arrow Mark Text Color"));this.bindControl(new SimpleStringBinder(a,this._linetool.properties().text,null,!0,this.model(),"Change Arrow Mark Text"));this.bindControl(new Z10(d,this._linetool.properties().font,null,!0,this.model(),"Change Arrow Mark Font"));this.loadData();
|
|
setTimeout(function(){a.select();a.focus()},20)};Q88.prototype.widget=function(){return this._table};function W21(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W21,W49);
|
|
W21.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=this.createColorPicker(),d=TradingView.createTransparencyEditor(c),e=this.addLabeledRow(this._table,"Text Color");$("<td>").append(a).appendTo(e);e=this.addLabeledRow(this._table,"Border Color");$("<td>").append(b).appendTo(e);
|
|
e=this.addLabeledRow(this._table,"Background");$("<td>").append(c).appendTo(e);$("<td>").append(d).appendTo(e);this.bindControl(new ColorBinding(a,this._linetool.properties().color,!0,this.model(),"Change Price Text Color"));this.bindControl(new ColorBinding(b,this._linetool.properties().borderColor,!0,this.model(),"Change Border Color"));this.bindControl(new ColorBinding(c,this._linetool.properties().backgroundColor,!0,this.model(),"Change Background Color"));this.bindControl(new SliderBinder(d,
|
|
this._linetool.properties().transparency,!0,this.model(),"Change Background Transparency"));this.loadData()};W21.prototype.widget=function(){return this._table};function Q89(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q89,W49);
|
|
Q89.prototype.prepareLayout=function(){var a=$('<table class="property-page" cellspacing="0" cellpadding="0">').css({width:"100%"}).data("layout-tab-open",EditObjectDialog.TAB_OPEN_OVERRIDE),b=$('<table class="property-page" cellspacing="0" cellpadding="0">');this._table=a.add(b);var c=this.createColorPicker(),d=this.createColorPicker(),e=this.createColorPicker(),f=TradingView.createTransparencyEditor(e),g=$("<input type='text'>").css({width:"100%"}),a=$("<tr>").appendTo(a),
|
|
h=$('<div class="property-page-fullwidth-wrapper">').append(g);$("<td>").css({width:"0"}).append(c).appendTo(a);$("<td>").append(h).appendTo(a);a=this.addLabeledRow(b,"Background");$("<td>").appendTo(a).append(e);$("<td>").appendTo(a).append(f);a=this.addLabeledRow(b,"Border Color");$("<td>").appendTo(a).append(d);$("<td>");this.bindControl(new ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Balooon Text Color"));this.bindControl(new ColorBinding(d,this._linetool.properties().borderColor,
|
|
!0,this.model(),"Change Balloon Border Color"));this.bindControl(new ColorBinding(e,this._linetool.properties().backgroundColor,!0,this.model(),"Change Balloon Background Color"));this.bindControl(new SliderBinder(f,this._linetool.properties().transparency,!0,this.model(),"Change Balloon Background Transparency"));this.bindControl(new SimpleStringBinder(g,this._linetool.properties().text,null,!0,this.model(),"Change Balloon Text"));this.loadData();setTimeout(function(){g.select();g.focus()},0)};
|
|
Q89.prototype.widget=function(){return this._table};function Q92(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q92,W49);
|
|
Q92.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);this.bindControl(new ColorBinding(b,this._linetool.properties().linecolor,!0,this.model(),"Change Brush Color"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Brush Line Width"));this.bindControl(new Z11(c,this._linetool.properties().fillBackground,!0,this.model(),"Change Brush Filling"));this.bindControl(new ColorBinding(d,
|
|
this._linetool.properties().backgroundColor,!0,this.model(),"Change Brush Background Color"));this.bindControl(new SliderBinder(e,this._linetool.properties().transparency,!0,this.model(),"Change Brush Background Transparency"));this.loadData()};Q92.prototype.widget=function(){return this._table};function W20(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W20,W49);
|
|
W20.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"),q=this.addColorPickerRow(g,"Target border color"),n=this.addColorPickerRow(g,"Failure back color"),g=this.addColorPickerRow(g,"Failure text color"),t=TradingView.createTransparencyEditor(l);this.addEditorRow(c,"Transparency",t);this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),"Forecast Line Color"));this.bindControl(new SliderBinder(e,
|
|
this._linetool.properties().linewidth,!0,this.model(),"Forecast Line Width"));this.bindControl(new ColorBinding(b,this._linetool.properties().sourceBackColor,!0,this.model(),"Forecast Source Background Color"));this.bindControl(new ColorBinding(h,this._linetool.properties().sourceStrokeColor,!0,this.model(),"Forecast Source Border Color"));this.bindControl(new ColorBinding(a,this._linetool.properties().sourceTextColor,!0,this.model(),"Forecast Source Text Color"));this.bindControl(new ColorBinding(l,
|
|
this._linetool.properties().targetBackColor,!0,this.model(),"Forecast Target Background Color"));this.bindControl(new ColorBinding(q,this._linetool.properties().targetStrokeColor,!0,this.model(),"Forecast Target Border Color"));this.bindControl(new ColorBinding(m,this._linetool.properties().targetTextColor,!0,this.model(),"Forecast Target Text Color"));this.bindControl(new ColorBinding(k,this._linetool.properties().successBackground,!0,this.model(),"Forecast Success Back Color"));this.bindControl(new ColorBinding(f,
|
|
this._linetool.properties().successTextColor,!0,this.model(),"Forecast Success Text Color"));this.bindControl(new ColorBinding(n,this._linetool.properties().failureBackground,!0,this.model(),"Forecast Failure Back Color"));this.bindControl(new ColorBinding(g,this._linetool.properties().failureTextColor,!0,this.model(),"Forecast Failure Text Color"));this.bindControl(new SliderBinder(t,this._linetool.properties().transparency,!0,this.model(),"Change Forecast Background Transparency"));this.loadData()};
|
|
W20.prototype.widget=function(){return this._table};function W19(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W19,W49);
|
|
W19.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 Z11(e,this._linetool.properties().fillBackground,!0,this.model(),"Change Polyline Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().linecolor,
|
|
!0,this.model(),"Change Polyline Line Color"));this.bindControl(new ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),"Change Polyline Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Polyline Border Width"));this.bindControl(new SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Polyline Background Transparency"));this.loadData()};
|
|
W19.prototype.widget=function(){return this._table};function W10(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W10,W49);
|
|
W10.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 Z11(a,c.visible,!0,this.model(),"Change Gann Square Line Visibility"));this.bindControl(new SimpleStringBinder(e,c.coeff,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 ColorBinding(b,c.color,!0,this.model(),"Change Gann Square Line Color"))};
|
|
W10.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,"Left Labels",c);$("<td>").append(c).prependTo(a);a=this.addLabeledRow(b,"Right Labels",d);$("<td>").append(d).prependTo(a);a=this.addLabeledRow(h,"Top Labels",e);$("<td>").append(e).prependTo(a);a=this.addLabeledRow(b,"Bottom Labels",f);$("<td>").append(f).prependTo(a);this.bindControl(new Z11(c,this._linetool.properties().showLeftLabels,!0,this.model(),"Change Gann Square Left Labels Visibility"));this.bindControl(new Z11(d,this._linetool.properties().showRightLabels,
|
|
!0,this.model(),"Change Gann Square Right Labels Visibility"));this.bindControl(new Z11(e,this._linetool.properties().showTopLabels,!0,this.model(),"Change Gann Square Top Labels Visibility"));this.bindControl(new Z11(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 Z11(c,this._linetool.properties().fillHorzBackground,!0,this.model(),"Change Gann Square Background Visibility"));this.bindControl(new 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 Z11(c,this._linetool.properties().fillVertBackground,!0,this.model(),"Change Gann Square Background Visibility"));this.bindControl(new SliderBinder(d,this._linetool.properties().vertTransparency,!0,this.model(),"Change Gann Square Background Transparency"));this.loadData()};W10.prototype.widget=function(){return this._table};function W8(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W8,W49);
|
|
W8.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 Z11(d,f.visible,!0,this.model(),"Change Gann Line Visibility"));this.bindControl(new ColorBinding(h,f.color,
|
|
!0,this.model(),"Change Gann Line Color"));this.bindControl(new 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 Z11(d,f.visible,!0,this.model(),"Change Gann Line Visibility")),this.bindControl(new ColorBinding(h,f.color,!0,this.model(),"Change Gann Fan Color")),this.bindControl(new 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 Z11(d,a.visible,!0,this.model(),"Change Gann Line Visibility")),this.bindControl(new ColorBinding(h,
|
|
a.color,!0,this.model(),"Change Gann Arc Color")),this.bindControl(new 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 Z11(b,
|
|
this._linetool.properties().arcsBackground.fillBackground,!0,this.model(),"Change Gann Square Filling"));this.bindControl(new SliderBinder(e,this._linetool.properties().arcsBackground.transparency,!0,this.model(),"Change Gann Square Background Transparency"))};W8.prototype.widget=function(){return this._table};function W9(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W9,W49);
|
|
W9.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 Z11(c,b.visible,!0,this.model(),"Change Gann Fan Line Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Gann Fan Line Color"));this.bindControl(new Z10(e,b.linestyle,parseInt,!0,this.model(),"Change Gann Fan Line Style"));this.bindControl(new SliderBinder(d,b.linewidth,!0,this.model(),"Change Gann Fan Line Width"))};
|
|
W9.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 Z11(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 Z11(a,this._linetool.properties().fillBackground,
|
|
!0,this.model(),"Change Pitchfan Background Visibility"));this.bindControl(new SliderBinder(b,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfan Background Transparency"));this.loadData()};W9.prototype.widget=function(){return this._table};function Q84(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q84,W49);
|
|
Q84.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 SimpleStringBinder(f,b.coeff,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 Z10(d,b.linestyle,parseInt,!0,this.model(),"Change Fib Circle Style")));this.bindControl(new Z11(c,b.visible,!0,this.model(),"Change Fib Circle Visibility"));this.bindControl(new ColorBinding(e,b.color,
|
|
!0,this.model(),"Change Fib Circle Line Color"));this.bindControl(new SliderBinder(f,b.linewidth,!0,this.model(),"Change Fib Circle Width"))};
|
|
Q84.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 Z11(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 Z11(c,this._linetool.properties().fillBackground,!0,this.model(),"Change Pitchfork Background Visibility"));this.bindControl(new SliderBinder(d,this._linetool.properties().transparency,!0,this.model(),"Change Pitchfork Background Transparency"));this.bindControl(new Z11(b,this._linetool.properties().coeffsAsPercents,!0,this.model(),"Change Fib Retracement Coeffs As Percents"));this.loadData()};
|
|
Q84.prototype.widget=function(){return this._table};function W1(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W1,W49);
|
|
W1.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 SimpleStringBinder(e,b.coeff,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 Z11(c,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new Z10(d,b.linestyle,parseInt,
|
|
!0,this.model(),"Change Pitchfork Line Style"));this.bindControl(new SliderBinder(e,b.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))};
|
|
W1.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'>"),d=$("<input type='checkbox' class='visibility-switch'>"),
|
|
a=$("<input type='checkbox' class='visibility-switch'>"),b=$("<input type='checkbox' class='visibility-switch'>"),e=$("<input type='checkbox' class='visibility-switch'>"),f=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),g=$("<tr>").appendTo(f),h=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(g)),g=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(g)),
|
|
h=this.addLabeledRow(h,"Levels",c);$("<td>").append(c).prependTo(h);h=this.addLabeledRow(g,"Prices",d);$("<td>").append(d).prependTo(h);h=this.addLabeledRow(this._table,"Extend Lines",a);$("<td>").append(a).prependTo(h);h=this.addLabeledRow(this._table,"Reverse",b);$("<td>").append(b).prependTo(h);h=this.addLabeledRow(this._table,"Coeffs As Percents",e);$("<td>").append(e).prependTo(h);this.bindControl(new Z11(d,this._linetool.properties().showPrices,!0,this.model(),"Change Gann Fan Prices Visibility"));
|
|
this.bindControl(new Z11(c,this._linetool.properties().showCoeffs,!0,this.model(),"Change Gann Fan Levels Visibility"));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>");g=$("<select><option value='bottom'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='top'>"+$.t("bottom")+"</option></select>");
|
|
h=$("<tr>");h.append("<td>"+$.t("Labels")+"</td>").append(d).append("<td> </td>").append(g);h.appendTo(c);h=$("<tr>");$("<td colspan='5'>").append(c).appendTo(h);h.appendTo(this._table);this.bindControl(new Z10(d,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Fib Retracement Labels Alignment"));this.bindControl(new Z10(g,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Fib Retracement Labels Alignment"));this._table=
|
|
this._table.add(f);h=$("<tr>");h.appendTo(this._table);f=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(f).appendTo(h);this.createLabeledCell("Background",f).appendTo(h);c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(h);this.bindControl(new Z11(f,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,
|
|
!0,this.model(),"Change Fib Retracement Background Transparency"));this.bindControl(new Z11(a,this._linetool.properties().extendLines,!0,this.model(),"Change Fib Retracement Extend Lines"));this.bindControl(new Z11(b,this._linetool.properties().reverse,!0,this.model(),"Change Fib Retracement Reverse"));this.bindControl(new Z11(e,this._linetool.properties().coeffsAsPercents,!0,this.model(),"Change Fib Retracement Coeffs As Percents"));this.loadData()};
|
|
W1.prototype.widget=function(){return this._table};function Q99(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q99,W49);
|
|
Q99.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 SimpleStringBinder(e,b.coeff,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 Z11(c,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new Z10(d,b.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style"));
|
|
this.bindControl(new SliderBinder(e,b.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))};
|
|
Q99.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 c=$("<input type='checkbox' class='visibility-switch'>"),d=$("<input type='checkbox' class='visibility-switch'>"),a=$("<input type='checkbox' class='visibility-switch'>"),
|
|
b=$("<input type='checkbox' class='visibility-switch'>"),e=$("<input type='checkbox' class='visibility-switch'>"),f=$('<table class="property-page property-page-unpadded" cellspacing="0" cellpadding="0">').css({width:"100%"}),g=$("<tr>").appendTo(f),h=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(g)),g=$('<table class="property-page" cellspacing="0" cellpadding="0">').appendTo($("<td>").css({width:"50%"}).appendTo(g)),h=this.addLabeledRow(h,
|
|
"Levels",c);$("<td>").append(c).prependTo(h);h=this.addLabeledRow(g,"Prices",d);$("<td>").append(d).prependTo(h);h=this.addLabeledRow(this._table,"Extend Left",a);$("<td>").append(a).prependTo(h);h=this.addLabeledRow(this._table,"Extend Right",b);$("<td>").append(b).prependTo(h);h=this.addLabeledRow(this._table,"Coeffs As Percents",e);$("<td>").append(e).prependTo(h);this.bindControl(new Z11(d,this._linetool.properties().showPrices,!0,this.model(),"Change Gann Fan Prices Visibility"));this.bindControl(new Z11(c,
|
|
this._linetool.properties().showCoeffs,!0,this.model(),"Change Gann Fan Levels Visibility"));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>");g=$("<select><option value='bottom'>"+$.t("top")+"</option><option value='middle'>"+$.t("middle")+"</option><option value='top'>"+$.t("bottom")+"</option></select>");h=$("<tr>");h.append("<td>"+$.t("Labels")+
|
|
"</td>").append(d).append("<td> </td>").append(g);h.appendTo(c);h=$("<tr>");$("<td colspan='5'>").append(c).appendTo(h);h.appendTo(this._table);this.bindControl(new Z10(d,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Fib Retracement Labels Alignment"));this.bindControl(new Z10(g,this._linetool.properties().vertLabelsAlign,null,!0,this.model(),"Change Fib Retracement Labels Alignment"));this._table=this._table.add(f);h=$("<tr>");h.appendTo(this._table);
|
|
f=$("<input type='checkbox' class='visibility-switch'>");$("<td>").append(f).appendTo(h);this.createLabeledCell("Background",f).appendTo(h);c=TradingView.createTransparencyEditor();$('<td colspan="3">').append(c).appendTo(h);this.bindControl(new Z11(f,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency"));
|
|
this.bindControl(new Z11(a,this._linetool.properties().extendLeft,!0,this.model(),"Change Fib Retracement Extend Lines"));this.bindControl(new Z11(b,this._linetool.properties().extendRight,!0,this.model(),"Change Fib Retracement Extend Lines"));this.bindControl(new Z11(e,this._linetool.properties().coeffsAsPercents,!0,this.model(),"Change Fib Retracement Coeffs As Percents"));this.loadData()};Q99.prototype.widget=function(){return this._table};function W30(a,b,c){W1.call(this,a,b,c)}inherit(W30,W1);function W31(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W31,W49);
|
|
W31.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 SimpleStringBinder(e,b.coeff,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 Z11(c,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new Z10(d,b.linestyle,parseInt,
|
|
!0,this.model(),"Change Pitchfork Line Style"));this.bindControl(new SliderBinder(e,b.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))};
|
|
W31.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 Z10(d,this._linetool.properties().horzLabelsAlign,
|
|
null,!0,this.model(),"Change Trend-Based Fib Time Labels Alignment"));this.bindControl(new Z10(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 Z11(c,
|
|
this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new SliderBinder(d,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency"));this.bindControl(new Z11(a,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Retracement Extend Lines"));this.loadData()};W31.prototype.widget=function(){return this._table};function W3(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W3,W49);
|
|
W3.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 Z11(a,c.visible,!0,this.model(),"Change Gann Square Line Visibility"));this.bindControl(new SimpleStringBinder(e,c.coeff,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 ColorBinding(b,c.color,!0,this.model(),"Change Gann Square Line Color"))};
|
|
W3.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 Z11(c,this._linetool.properties().showLeftLabels,!0,this.model(),"Change Gann Square Left Labels Visibility"));this.bindControl(new Z11(d,this._linetool.properties().showRightLabels,
|
|
!0,this.model(),"Change Gann Square Right Labels Visibility"));this.bindControl(new Z11(e,this._linetool.properties().showTopLabels,!0,this.model(),"Change Gann Square Top Labels Visibility"));this.bindControl(new Z11(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 Z11(c,this._linetool.properties().grid.visible,!0,this.model(),"Change Fib Speed Resistance Fan Grid Visibility"));this.bindControl(new ColorBinding(g,this._linetool.properties().grid.color,!0,this.model(),"Change Fib Speed Resistance Fan Grid Line Color"));
|
|
this.bindControl(new Z10(f,this._linetool.properties().grid.linestyle,parseInt,!0,this.model(),"Change Fib Speed Resistance Fan Grid Line Style"));this.bindControl(new 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 Z11(c,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Speed/Resistance Fan Background Visibility"));this.bindControl(new SliderBinder(b,this._linetool.properties().transparency,!0,this.model(),"Change Fib Speed/Resistance Fan Background Transparency"));this.loadData()};W3.prototype.widget=function(){return this._table};function W2(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W2,W49);
|
|
W2.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 SimpleStringBinder(f,b.coeff,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 Z10(d,b.linestyle,parseInt,!0,this.model(),"Change Fib Speed Resistance Arcs Style")));this.bindControl(new Z11(c,b.visible,!0,this.model(),"Change Fib Speed Resistance Arcs Visibility"));this.bindControl(new ColorBinding(e,
|
|
b.color,!0,this.model(),"Change Fib Speed Resistance Arcs Line Color"));this.bindControl(new SliderBinder(f,b.linewidth,!0,this.model(),"Change Fib Speed Resistance Arcs Width"))};
|
|
W2.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");$("<td>").append(b).prependTo(a);this.bindControl(new Z11(b,this._linetool.properties().showCoeffs,!0,this.model(),"Change Fib Speed Resistance Arcs Levels Visibility"));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 Z11(b,this._linetool.properties().fillBackground,
|
|
!0,this.model(),"Change Fib Arcs Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Fib Arcs Background Transparency"));this.loadData()};W2.prototype.widget=function(){return this._table};function W4(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W4,W49);
|
|
W4.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 ColorBinding(d,this._linetool.properties().linecolor,
|
|
!0,this.model(),"Change Fib Spiral Line Color"));this.bindControl(new Z10(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Fib Spiral Line Style"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Fib Spiral Line Width"));this.loadData()};W4.prototype.widget=function(){return this._table};function W5(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W5,W49);
|
|
W5.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 SimpleStringBinder(e,b.coeff,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 Z11(c,b.visible,!0,this.model(),"Change Pitchfork Line Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Pitchfork Line Color"));this.bindControl(new Z10(d,b.linestyle,parseInt,!0,this.model(),"Change Pitchfork Line Style"));
|
|
this.bindControl(new SliderBinder(e,b.linewidth,parseInt,this.model(),"Change Pitchfork Line Width"))};
|
|
W5.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 Z10(g,this._linetool.properties().horzLabelsAlign,null,!0,this.model(),"Change Fib Time Zone Labels Alignment"));this.bindControl(new Z10(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 Z11(d,this._linetool.properties().showLabels,!0,this.model(),"Change Fib Time Zone Labels Visibility"));this.bindControl(new ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Fib Time Zone Color"));this.bindControl(new Z10(b,this._linetool.properties().linestyle,
|
|
parseInt,!0,this.model(),"Change Fib Time Zone Style"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Fib Time Zone Width"));this.bindControl(new Z11(f,this._linetool.properties().fillBackground,!0,this.model(),"Change Fib Retracement Background Visibility"));this.bindControl(new SliderBinder(g,this._linetool.properties().transparency,!0,this.model(),"Change Fib Retracement Background Transparency"));this.loadData()};
|
|
W5.prototype.widget=function(){return this._table};function W6(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W6,W49);
|
|
W6.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 SimpleStringBinder(e,b.coeff,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 Z11(c,b.visible,!0,this.model(),"Change Fib Wedge Visibility"));this.bindControl(new ColorBinding(a,b.color,!0,this.model(),"Change Fib Wedge Line Color"));this.bindControl(new SliderBinder(d,b.linewidth,!0,this.model(),"Change Fib Wedge Width"))};
|
|
W6.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 Z11(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 Z11(b,this._linetool.properties().fillBackground,
|
|
!0,this.model(),"Change Wedge Background Visibility"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Wedge Background Transparency"));this.loadData()};W6.prototype.widget=function(){return this._table};function Q94(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q94,W49);
|
|
Q94.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 ColorBinding(c,
|
|
this._linetool.properties().linecolor,!0,this.model(),"Change Circle Lines Color"));this.bindControl(new Z10(b,this._linetool.properties().linestyle,parseInt,!0,this.model(),"Change Circle Lines Style"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,!0,this.model(),"Change Circle Lines Width"));this.loadData()};Q94.prototype.widget=function(){return this._table};function W24(a,b,c){Z6.call(this,a,b);this._linetool=c;this.prepareLayout()}inherit(W24,W14);
|
|
W24.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":EditObjectDialog.TAB_NAME_INPUTS,"layout-tab-priority":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);
|
|
barEditCell=$("<td>");barEditCell.appendTo(e);e=$("<input type='text'>");e.appendTo(barEditCell);e.addClass("ticker");var f=this._linetool.properties().points[d],g=[ToIntTransformer(f.bar.value()),GreateTransformer(-5E3),LessTransformer(15E3)];this.bindControl(new SimpleStringBinder(e,f.bar,g,!1,this.model(),"Change "+this._linetool+" point bar index"))}a=StudyMetaInfo.findStudyMetaInfo(this.D99.studiesMetaData(),"RegressionTrend@tv-basicstudies");W41.prototype.prepareLayoutImpl.call(this,
|
|
a,b)};W24.prototype.widget=function(){return this._table};function Q95(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q95,W49);
|
|
Q95.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(),q=TradingView.createTransparencyEditor(m),n=$('<input type="checkbox" class="visibility-switch">');this.bindControl(new ColorBinding(d,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color"));this.bindControl(new Z10(f,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));
|
|
this.bindControl(new Z10(g,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new ColorBinding(h,this._linetool.properties().labelBackgroundColor,!0,this.model(),"Change Text Background"));this.bindControl(new SliderBinder(k,this._linetool.properties().labelBackgroundTransparency,!0,this.model(),"Change Text Background Transparency"));this.bindControl(new Z11(l,this._linetool.properties().fillLabelBackground,!0,this.model(),"Change Text Background Fill"));
|
|
this.bindControl(new ColorBinding(m,this._linetool.properties().backgroundColor,!0,this.model(),"Change Text Background"));this.bindControl(new SliderBinder(q,this._linetool.properties().backgroundTransparency,!0,this.model(),"Change Text Background Transparency"));this.bindControl(new Z11(n,this._linetool.properties().fillBackground,!0,this.model(),"Change Text Background Fill"));this.bindControl(new ColorBinding(e,this._linetool.properties().borderColor,!0,this.model(),"Change Text Border Color"));
|
|
e=this.addLabeledRow(a,"Background",n);$("<td>").append(n).prependTo(e);$("<td>").append(m).appendTo(e);$('<td colspan="2">').append(q).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 ColorBinding(c,this._linetool.properties().linecolor,
|
|
!0,this.model(),"Change Date Range Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Date Range Line Width"));this.loadData()};Q95.prototype.widget=function(){return this._table};function W22(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W22,W49);
|
|
W22.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 ColorBinding(f,this._linetool.properties().trendline.color,!0,this.model(),"Change Projection Line Color"));this.bindControl(new ColorBinding(a,this._linetool.properties().color1,!0,this.model(),"Change Projection Background Color"));this.bindControl(new ColorBinding(b,this._linetool.properties().color2,!0,this.model(),"Change Projection Background Color"));
|
|
this.bindControl(new SliderBinder(e,this._linetool.properties().linewidth,!0,this.model(),"Change Projection Border Width"));this.bindControl(new SliderBinder(c,this._linetool.properties().transparency,!0,this.model(),"Change Projection Background Transparency"));this.loadData()};W22.prototype.widget=function(){return this._table};function W15(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W15,W49);
|
|
W15.prototype.prepareLayout=function(){function a(){q.slider("option","disabled",!n.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(),q=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(q).appendTo(k);var n=this._linetool.properties().fillBackground;
|
|
a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new Z11(l,this._linetool.properties().fillBackground,!0,this.model(),"Change Pattern Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color"));this.bindControl(new ColorBinding(d,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color"));this.bindControl(new ColorBinding(m,this._linetool.properties().backgroundColor,
|
|
!0,this.model(),"Change Pattern Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Pattern Border Width"));this.bindControl(new SliderBinder(q,this._linetool.properties().transparency,!0,this.model(),"Change Pattern Background Transparency"));this.bindControl(new Z10(g,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new Z10(h,this._linetool.properties().font,
|
|
null,!0,this.model(),"Change Text Font"));this.bindControl(new Z11(e,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new Z11(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()};W15.prototype.widget=function(){return this._table};function Q86(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q86,W49);
|
|
Q86.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 ColorBinding(b,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color"));this.bindControl(new ColorBinding(c,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color"));this.bindControl(new SliderBinder(a,this._linetool.properties().linewidth,
|
|
!0,this.model(),"Change Pattern Border Width"));this.bindControl(new Z10(f,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new Z10(g,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new Z11(d,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new Z11(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()};Q86.prototype.widget=function(){return this._table};function LineToolNotePropertyPage(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(LineToolNotePropertyPage,W49);
|
|
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 ColorBinding(a,
|
|
this._linetool.properties().textColor,!0,this.model(),$.t("Change Text Color")));this.bindControl(new Z10(b,this._linetool.properties().fontSize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new Z10(c,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new SimpleStringBinder(d,this._linetool.properties().text,null,!0,this.model(),$.t("Change Text")));this.bindControl(new ColorBinding(e,this._linetool.properties().markerColor,
|
|
!0,this.model(),$.t("Change Marker and Border Color")));this.bindControl(new ColorBinding(f,this._linetool.properties().backgroundColor,!0,this.model(),$.t("Change Background Color")));this.bindControl(new SliderBinder(g,this._linetool.properties().backgroundTransparency,!0,this.model(),"Change Background Transparency"));this.bindControl(new Z11(h,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new Z11(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">'),q=$('<table class="property-page" cellspacing="0" cellpadding="2">');this._table=l.add(q).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(q,$.t("Label"));$("<td>").attr("colspan",2).append(e).appendTo(a);a=this.addLabeledRow(q,$.t("Background"));$("<td>").append(f).appendTo(a);$("<td>").append(g).appendTo(a);this.loadData();setTimeout(function(){d.select();d.focus()},20)};LineToolNotePropertyPage.prototype.widget=function(){return this._table};
|
|
LineToolNotePropertyPage.prototype.dialogPosition=function(a,b){if(a&&b){for(var c=0,d=this._linetool.D99.paneForSource(this._linetool),e=Q45.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().item(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}};function W43(a,b,c){Z6.call(this,a,b);this._linetool=c;this.prepareLayout()}inherit(W43,W14);
|
|
W43.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":EditObjectDialog.TAB_NAME_INPUTS,"layout-tab-priority":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);barEditCell=
|
|
$("<td>");barEditCell.appendTo(e);e=$("<input type='text'>");e.appendTo(barEditCell);e.addClass("ticker");var f=this._linetool.properties().points[d],g=[ToIntTransformer(f.bar.value()),GreateTransformer(-5E3),LessTransformer(15E3)];this.bindControl(new SimpleStringBinder(e,f.bar,g,!1,this.model(),"Change "+this._linetool+" point bar index"))}a=StudyMetaInfo.findStudyMetaInfo(this.D99.studiesMetaData(),this._linetool.studyId());W41.prototype.prepareLayoutImpl.call(this,a,b)};
|
|
W43.prototype.widget=function(){return this._table};function W44(a,b,c){Z6.call(this,a,b);this.Z0=c;this.prepareLayout()}inherit(W44,Z6);inherit(W44,SeriesStylePropertyPageMixin);
|
|
W44.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.Z0.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 Z11(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 Z10(d,f.minTick,null,!0,this.model(),"Change MinTick"))};
|
|
W44.prototype.loadData=function(){this.superclass.prototype.loadData.call(this);this.switchStyle()};
|
|
W44.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.Z0.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")}};W44.prototype.widget=function(){return this._table};function Q97(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q97,W49);
|
|
Q97.prototype.prepareLayout=function(){this._table=$('<table class="property-page" cellspacing="0" cellpadding="2">');var a=[],a=6===this._linetool.pointsCount()?"Subminuette Minuette Minute Minor Intermediate Primary Cycle SuperCycle GrandSuperCycle".split(" ").map(function(a){return $.t(a)}):["Minor","Major"].map(function(a){return $.t(a)});waveTypeEditor=this.createKeyCombo(a);waveTypeEditor.width(300);this.createFontEditor();a=this.createFontSizeEditor();$('<span class="property-page-small-select">').append(a);
|
|
var a=this.createColorPicker(),b=$('<input type="checkbox" class="visibility-switch">'),c=$('<input type="checkbox" class="visibility-switch">'),d=this.addLabeledRow(this._table,"Wave Size");$("<td>").prependTo(d);$("<td>").append(waveTypeEditor).appendTo(d);d=this.addLabeledRow(this._table,"Color");$("<td>").prependTo(d);$("<td>").append(a).appendTo(d);d=this.addLabeledRow(this._table,"Show Wave",c);$("<td>").append(c).prependTo(d);d=this.addLabeledRow(this._table,"Show Background",b);$("<td>").append(b).prependTo(d);
|
|
this.bindControl(new Z11(b,this._linetool.properties().showBackground,!0,this.model(),"Change Elliott Labels Background"));this.bindControl(new ColorBinding(a,this._linetool.properties().color,!0,this.model(),"Change Elliott Label Color"));this.bindControl(new Z10(waveTypeEditor,this._linetool.properties().wavesize,parseInt,!0,this.model(),"Change Elliott Wave Size"));this.bindControl(new Z11(c,this._linetool.properties().showWave,!0,this.model(),"Change Elliott Labels Background"));
|
|
this.loadData()};Q97.prototype.widget=function(){return this._table};function W25(a,b,c){W14.call(this,a,b,c);this.prepareLayout()}inherit(W25,W14);
|
|
W25.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=[ToIntTransformer(this._linetool.properties().stopLevel.value()),GreateTransformer(0),LessTransformer(1E9)];this.bindControl(new SimpleStringBinder(c,this._linetool.properties().stopLevel,
|
|
a,!1,this.model(),"Change "+this._linetool+" stop level"));a=[ToIntTransformer(this._linetool.properties().profitLevel.value()),GreateTransformer(0),LessTransformer(1E9)];this.bindControl(new SimpleStringBinder(e,this._linetool.properties().profitLevel,a,!1,this.model(),"Change "+this._linetool+" profit level"));a=[ToFloatTransformer(this._linetool.properties().entryPrice.value())];this.bindControl(new SimpleStringBinder(f,this._linetool.properties().entryPrice,a,!1,this.model(),"Change "+this._linetool+
|
|
" entry price"));var k=this,a=[ToFloatTransformer(this._linetool.properties().stopPrice.value()),function(a){return k._linetool.preparseStopPrice(a)}];this.bindControl(new SimpleStringBinder(d,this._linetool.properties().stopPrice,a,!1,this.model(),"Change "+this._linetool+" stop price"));a=[ToFloatTransformer(this._linetool.properties().targetPrice.value()),function(a){return k._linetool.preparseProfitPrice(a)}];this.bindControl(new SimpleStringBinder(h,this._linetool.properties().targetPrice,a,
|
|
!1,this.model(),"Change "+this._linetool+" stop price"))};W25.prototype.widget=function(){return this._table};function W26(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W26,W49);
|
|
W26.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 ColorBinding(c,this._linetool.properties().linecolor,!0,this.model(),"Change Risk/Reward line Color"));
|
|
this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Risk/Reward line width"));this.bindControl(new ColorBinding(e,this._linetool.properties().stopBackground,!0,this.model(),"Change stop color"));this.bindControl(new SliderBinder(f,this._linetool.properties().stopBackgroundTransparency,!0,this.model(),"Change Stop Background Transparency"));this.bindControl(new ColorBinding(g,this._linetool.properties().profitBackground,!0,this.model(),"Change target color"));
|
|
this.bindControl(new SliderBinder(h,this._linetool.properties().profitBackgroundTransparency,!0,this.model(),"Change Profit Background Transparency"));this.bindControl(new Z10(k,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new Z10(l,this._linetool.properties().font,null,!0,this.model(),"Change Text Font"));this.bindControl(new ColorBinding(a,this._linetool.properties().textcolor,!0,this.model(),"Change Text Color"));
|
|
this.loadData()};W26.prototype.widget=function(){return this._table};function W33(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W33,W49);
|
|
W33.prototype.prepareLayout=function(){function a(){q.slider("option","disabled",!n.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(),q=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(q).appendTo(k);var n=this._linetool.properties().fillBackground;
|
|
a();this._linetool.properties().fillBackground.subscribe(null,a);this.bindControl(new Z11(l,this._linetool.properties().fillBackground,!0,this.model(),"Change Pattern Filling"));this.bindControl(new ColorBinding(c,this._linetool.properties().color,!0,this.model(),"Change Pattern Line Color"));this.bindControl(new ColorBinding(d,this._linetool.properties().textcolor,!0,this.model(),"Change Pattern Text Color"));this.bindControl(new ColorBinding(m,this._linetool.properties().backgroundColor,
|
|
!0,this.model(),"Change Pattern Background Color"));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),"Change Pattern Border Width"));this.bindControl(new SliderBinder(q,this._linetool.properties().transparency,!0,this.model(),"Change Pattern Background Transparency"));this.bindControl(new Z10(g,this._linetool.properties().fontsize,parseInt,!0,this.model(),"Change Text Font Size"));this.bindControl(new Z10(h,this._linetool.properties().font,
|
|
null,!0,this.model(),"Change Text Font"));this.bindControl(new Z11(e,this._linetool.properties().bold,!0,this.model(),"Change Text Font Bold"));this.bindControl(new Z11(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()};W33.prototype.widget=function(){return this._table};function Q96(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(Q96,W49);
|
|
Q96.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(),q=TradingView.createTransparencyEditor(m),e=this.addLabeledRow(e,$.t("Background"),l),n=$("<table>");$('<td colspan="5">').append(n).appendTo(e);e=$("<tr>").appendTo(n);$("<td>").append(l).appendTo(e);$("<td>").append(m).appendTo(e);$("<td>").append(q).appendTo(e);var t=$("<tbody>").appendTo(this._table),u=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),n=$('<input type="checkbox">').appendTo(u),z=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),
|
|
s=$('<input type="checkbox">').appendTo(z),A=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),B=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),e=this.addLabeledRow(t,$.t("Left End"));$('<td colspan="3">').appendTo(e).append(A).append(u);e=this.addLabeledRow(t,$.t("Right End"));$('<td colspan="3">').appendTo(e).append(B).append(z);e=$("<tbody>").appendTo(this._table);e=$("<tr>").appendTo(e);
|
|
t=$("<input type='checkbox'>");u=$("<label style='display:block'>").append(t).append($.t("Show Prices"));$("<td colspan='2'>").append(u).appendTo(e);this.bindControl(new Z10(f,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new Z10(g,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new ColorBinding(a,this._linetool.properties().textcolor,!0,this.model(),$.t("Change Text Color")));
|
|
this.bindControl(new Z11(h,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new Z11(k,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));this.bindControl(new Z11(t,this._linetool.properties().showPrices,!0,this.model(),$.t("Change Disjoint Angle Show Prices")));this.bindControl(new Z11(n,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Disjoint Angle Extending Left")));
|
|
this.bindControl(new Z11(s,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Disjoint Angle Extending Right")));this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Disjoint Angle Color")));this.bindControl(new Z10(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Disjoint Angle Style")));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Disjoint Angle Width")));
|
|
this.bindControl(new Z10(A,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Left End")));this.bindControl(new Z10(B,this._linetool.properties().rightEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Right End")));this.bindControl(new Z11(l,this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Disjoint Angle Filling")));this.bindControl(new ColorBinding(m,this._linetool.properties().backgroundColor,
|
|
!0,this.model(),$.t("Change Disjoint Angle Background Color")));this.bindControl(new SliderBinder(q,this._linetool.properties().transparency,!0,this.model(),$.t("Change Disjoint Angle Background Transparency")));this.loadData()};Q96.prototype.widget=function(){return this._table};function W7(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W7,W49);
|
|
W7.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(),q=TradingView.createTransparencyEditor(m),e=this.addLabeledRow(e,$.t("Background"),l),n=$("<table>");$('<td colspan="5">').append(n).appendTo(e);e=$("<tr>").appendTo(n);$("<td>").append(l).appendTo(e);$("<td>").append(m).appendTo(e);$("<td>").append(q).appendTo(e);var t=$("<tbody>").appendTo(this._table),u=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),n=$('<input type="checkbox">').appendTo(u),z=$("<label>"+$.t("Extend")+" </label>").css({"margin-left":"8px"}),
|
|
s=$('<input type="checkbox">').appendTo(z),A=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),B=$("<select><option value='0'>"+$.t("Normal")+"</option><option value='1'>"+$.t("Arrow")+"</option></select>"),e=this.addLabeledRow(t,$.t("Left End"));$('<td colspan="3">').appendTo(e).append(A).append(u);e=this.addLabeledRow(t,$.t("Right End"));$('<td colspan="3">').appendTo(e).append(B).append(z);e=$("<tbody>").appendTo(this._table);e=$("<tr>").appendTo(e);
|
|
t=$("<input type='checkbox'>");u=$("<label style='display:block'>").append(t).append($.t("Show Prices"));$("<td colspan='2'>").append(u).appendTo(e);this.bindControl(new Z10(f,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new Z10(g,this._linetool.properties().font,null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new ColorBinding(a,this._linetool.properties().textcolor,!0,this.model(),$.t("Change Text Color")));
|
|
this.bindControl(new Z11(h,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new Z11(k,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));this.bindControl(new Z11(t,this._linetool.properties().showPrices,!0,this.model(),$.t("Change Disjoint Angle Show Prices")));this.bindControl(new Z11(n,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Disjoint Angle Extending Left")));
|
|
this.bindControl(new Z11(s,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Disjoint Angle Extending Right")));this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Disjoint Angle Color")));this.bindControl(new Z10(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Disjoint Angle Style")));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Disjoint Angle Width")));
|
|
this.bindControl(new Z10(A,this._linetool.properties().leftEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Left End")));this.bindControl(new Z10(B,this._linetool.properties().rightEnd,parseInt,!0,this.model(),$.t("Change Disjoint Angle Right End")));this.bindControl(new Z11(l,this._linetool.properties().fillBackground,!0,this.model(),$.t("Change Disjoint Angle Filling")));this.bindControl(new ColorBinding(m,this._linetool.properties().backgroundColor,
|
|
!0,this.model(),$.t("Change Disjoint Angle Background Color")));this.bindControl(new SliderBinder(q,this._linetool.properties().transparency,!0,this.model(),$.t("Change Disjoint Angle Background Transparency")));this.loadData()};W7.prototype.widget=function(){return this._table};function W13(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W13,W49);
|
|
W13.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 ColorBinding(a,b.color,!0,this.model(),"Change Icon Color"));this.loadData()};
|
|
W13.prototype.widget=function(){return this._div};function W29(a,b,c){W49.call(this,a,b,c);this.prepareLayout()}inherit(W29,W49);
|
|
W29.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">'),q=$('<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(q);var n=$('<input type="checkbox">'),t=$('<input type="checkbox">'),u=$('<input type="checkbox">'),a=this.addLabeledRow(e,$.t("Show Price Range"));$('<td colspan="3">').appendTo(a).append(n);a=this.addLabeledRow(e,$.t("Show Bars Range"));$('<td colspan="3">').appendTo(a).append(t);a=this.addLabeledRow(e,$.t("Always Show Stats"));
|
|
$('<td colspan="3">').appendTo(a).append(u);this.bindControl(new Z11(n,this._linetool.properties().showPriceRange,!0,this.model(),$.t("Change Trend Line Show Price Range")));this.bindControl(new Z11(t,this._linetool.properties().showBarsRange,!0,this.model(),$.t("Change Trend Line Show Bars Range")));this.bindControl(new Z10(g,this._linetool.properties().fontsize,parseInt,!0,this.model(),$.t("Change Text Font Size")));this.bindControl(new Z10(h,this._linetool.properties().font,
|
|
null,!0,this.model(),$.t("Change Text Font")));this.bindControl(new ColorBinding(f,this._linetool.properties().textcolor,!0,this.model(),$.t("Change Text Color")));this.bindControl(new Z11(k,this._linetool.properties().bold,!0,this.model(),$.t("Change Text Font Bold")));this.bindControl(new Z11(l,this._linetool.properties().italic,!0,this.model(),$.t("Change Text Font Italic")));this.bindControl(new ColorBinding(d,this._linetool.properties().linecolor,!0,this.model(),$.t("Change Trend Line Color")));
|
|
this.bindControl(new Z10(c,this._linetool.properties().linestyle,parseInt,!0,this.model(),$.t("Change Trend Line Style")));this.bindControl(new SliderBinder(b,this._linetool.properties().linewidth,!0,this.model(),$.t("Change Trend Line Width")));this.bindControl(new Z11(m,this._linetool.properties().extendRight,!0,this.model(),$.t("Change Trend Angle Extending Right")));this.bindControl(new Z11(q,this._linetool.properties().extendLeft,!0,this.model(),$.t("Change Trend Angle Extending Left")));
|
|
this.bindControl(new Z11(u,this._linetool.properties().alwaysShowStats,!0,this.model(),$.t("Change Trend Line Always Show Stats")));this.loadData()};W29.prototype.widget=function(){return this._table};function W28(a,b,c){W14.call(this,a,b,c)}inherit(W28,W14);
|
|
W28.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=[ToFloatTransformer(b.price.value()),GreateTransformer(-360),LessTransformer(360)];
|
|
this.bindControl(new SimpleStringBinder(a,this._linetool.properties().angle,b,!1,this.model(),$.t("Change angle")));this.loadData()}};W28.prototype.widget=function(){return this._table};function W42(a,b,c){Z6.call(this,a,b);this.Z0=c;this.prepareLayout()}inherit(W42,Z6);
|
|
W42.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.Z0.properties(),d=[["Base",c.styles.baseLine],["Up",c.styles.upLine],["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(),q=this.addLabeledRow(a,g[0],h);f||(e=k);$("<td>").append(h).prependTo(q);$("<td>").append(k).appendTo(q);$("<td>").append(l).appendTo(q);$("<td>").append(m.render()).appendTo(q);q="Change "+g[0];this.bindControl(new Z11(h,g[1].visible,!0,this.model(),q));this.bindControl(new ColorBinding(k,g[1].color,!0,this.model(),q));this.bindControl(new SliderBinder(l,g[1].linewidth,!0,this.model(),q));this.bindControl(new Z10(m,g[1].linestyle,parseInt,
|
|
!0,this.model(),q))}a=$("<input type='checkbox' class='visibility-switch'/>");d=$("<input type='checkbox'/>");q=$("<tr>").appendTo(b);$("<td>").append(a).appendTo(q);this.createLabeledCell("Pearson's R",a).appendTo(q);q=$("<tr>").appendTo(b);$("<td>").append(d).appendTo(q);this.createLabeledCell("Extend Lines",d).appendTo(q);q=$("<tr>").appendTo(b);$("<td>").appendTo(q);$("<td>Background</td>").appendTo(q);b=TradingView.createTransparencyEditor(e);$("<td>").append(b).appendTo(q);this.bindControl(new Z11(a,
|
|
c.styles.showPearsons,!0,this.model(),"Change show Pearson's R"));this.bindControl(new Z11(d,c.styles.extendLines,!0,this.model(),"Change Extend Lines"));this.bindControl(new SliderBinder(b,c.styles.transparency,!0,this.model(),"Change Background Transparency"))};W42.prototype.widget=function(){return this._table};function W50(a,b,c){Z6.call(this,a,b);this.Z0=c;this.prepareLayout()}inherit(W50,Z6);
|
|
W50.prototype.prepareLayout=function(){var a=this.Z0.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 Z10(c,a.styles.vol.plottype,parseInt,!0,this.model(),"Change Volume Plot Style"));c=this.createColorPicker();$("<td>").append(c).appendTo(b);this.bindControl(new 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 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 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 Z11(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 Z10(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 ColorBinding(c,a.color,!0,
|
|
this.model(),"Change Volume MA color"));c=TradingView.createTransparencyEditor(c);$("<td>").append(c).appendTo(b);this.bindControl(new SliderBinder(c,a.transparency,!0,this.model(),"Change Volume MA Transparency"));c=TradingView.createLineWidthEditor();$("<td>").append(c).appendTo(b);this.bindControl(new 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 Z11(c,
|
|
a.trackPrice,!0,this.model(),"Change Price Line"))};W50.prototype.widget=function(){return this._table};Q3=function(a){this._$container=$(a);this._$header=this._$container.parent().find(".header").eq(0)};Q3.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})};
|
|
Q3.prototype.updateTitleFull=function(a,b){this._notification_count||(this._notification_count=0);b&&(this._notification_count+=b);0<=this._notification_count||(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))};Q3.prototype.clearNotifications=function(){this._notification_count=0;this.updateTitle()};
|
|
Q3.prototype.HIGHLIGHT_NUM_FLICKS=5;Q3.prototype.resize=$.noop;TradingView.NotesWidget=function(a){this.bridge=a;this.properties=a.properties;this.settings={};this.$container=a.$body;this.prepareLayout(this.$container);this.updateData();if(a.onMessage)a.onMessage(this.onBridgeMessage.bind(this));a.symbol&&a.symbol.subscribe(this.update.bind(this));a.interval&&a.interval.subscribe(this.updateInterval.bind(this));TradingView.pushStreamMultiplexer.on("ideas.channel",this.messageHandler.bind(this));this.favorites=new TradingView.NotesWidget.Favorites(TradingView.NotesWidget.FAV_KEY)};
|
|
TradingView.NotesWidget.SHOW_ONLY_PRIVATE_IDEAS="notes.show_only_private_ideas";TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_SYMBOL="notes.show_ideas_for_current_symbol";TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_RESOLUTION="notes.show_ideas_for_current_resolution";TradingView.NotesWidget.SHOW_ONLY_FAVORITE_IDEAS="notes_widget.show_only_favorite_ideas";TradingView.NotesWidget.FAV_KEY="notesAndIdeas.favorites";TradingView.NotesWidget.prototype.onChart=function(){return null!=this.bridge.getChartWidget()};
|
|
TradingView.NotesWidget.prototype.filterData=function(a){return this.showOnlyPrivateIdeas()&&a.is_public||this.showIdeasForCurrentSymbol()&&a.symbol!=this.bridge.symbol.value()||this.showIdeasForCurrentResolution()&&a.interval!=this.bridge.interval.value()||this.showOnlyFavoriteIdeas()&&!this.favorites.isFavorite(a.id)||0<this.listView.find(a.id).length?!1:!0};
|
|
TradingView.NotesWidget.prototype.messageHandler=function(a){this.filterData(a.idea)&&(a=new TradingView.NotesWidget.Idea(a.idea),this.listView.prepend(a),this.notesCache.addNote(),this.addListeners(a))};TradingView.NotesWidget.prototype.update=function(){this.bridge&&this.bridge.symbol&&this.updateData()};TradingView.NotesWidget.prototype.updateInterval=function(){this.bridge&&this.bridge.interval&&this.updateData()};
|
|
TradingView.NotesWidget.prototype.updateData=function(){if(is_authenticated){var a=this;this.notesCache=new TradingView.NotesCache(this.getRequestData());this.notesCache.requestNext().then(function(b){a.onData(b.charts)})}};TradingView.NotesWidget.prototype.appendData=function(){var a=this;this.listView.loading(!0);this.notesCache.requestNext().then(function(b){a.onData(b.charts,!0)}).always(function(){a.listView.loading(!1)})};
|
|
TradingView.NotesWidget.prototype.addListeners=function(a){var b=this;a.onClick(function(a,b){var e=new TradingView.HistoryManager.ChartPage(b.getImageUrl(),b.getName());e&&TradingView.historyManager.push(e)});a.onDelete(function(a,d){deleteChart(d.getImageUrl(),function(){b.listView.remove(d);b.notesCache.removeNote()})});a.onFavorite(function(a,d){b.favorites.toggleFavorite(d.getId());d.setFavorite(b.favorites.isFavorite(d.getId()))});a.setFavorite(b.favorites.isFavorite(a.getId()))};
|
|
TradingView.NotesWidget.prototype.onData=function(a,b){b||(this._scroll.scrollTo(0),this.listView.empty());for(var c=0;c<a.length;c++){var d=new TradingView.NotesWidget.Idea(a[c]);this.listView.add(d);this.addListeners(d)}};TradingView.NotesWidget.prototype.showOnlyFavoriteIdeas=function(){return TVSettings.getBool(TradingView.NotesWidget.SHOW_ONLY_FAVORITE_IDEAS,!1)};
|
|
TradingView.NotesWidget.prototype.showOnlyPrivateIdeas=function(){return TVSettings.getBool(TradingView.NotesWidget.SHOW_ONLY_PRIVATE_IDEAS,!1)};TradingView.NotesWidget.prototype.showIdeasForCurrentSymbol=function(){return TVSettings.getBool(TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_SYMBOL,!1)};TradingView.NotesWidget.prototype.showIdeasForCurrentResolution=function(){return TVSettings.getBool(TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_RESOLUTION,!1)};
|
|
TradingView.NotesWidget.prototype.toggleShowOnlyPrivateIdeas=function(){TVSettings.setValue(TradingView.NotesWidget.SHOW_ONLY_PRIVATE_IDEAS,!this.showOnlyPrivateIdeas());this.updateData()};TradingView.NotesWidget.prototype.toggleShowOnlyFavoriteIdeas=function(){TVSettings.setValue(TradingView.NotesWidget.SHOW_ONLY_FAVORITE_IDEAS,!this.showOnlyFavoriteIdeas());this.updateData()};
|
|
TradingView.NotesWidget.prototype.toggleIdeasForCurrentSymbol=function(){TVSettings.setValue(TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_SYMBOL,!this.showIdeasForCurrentSymbol());this.updateData()};TradingView.NotesWidget.prototype.toggleIdeasForCurrentResolution=function(){TVSettings.setValue(TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_RESOLUTION,!this.showIdeasForCurrentResolution());this.updateData()};
|
|
TradingView.NotesWidget.prototype.onBridgeMessage=function(a,b){a==TradingView.NotesWidget.SHOW_ONLY_PRIVATE_IDEAS?this.toggleShowOnlyPrivateIdeas():a==TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_SYMBOL?this.toggleIdeasForCurrentSymbol():a==TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_RESOLUTION?this.toggleIdeasForCurrentResolution():a==TradingView.NotesWidget.SHOW_ONLY_FAVORITE_IDEAS&&this.toggleShowOnlyFavoriteIdeas()};
|
|
TradingView.NotesWidget.prototype.prepareLayout=function(a){this._$widget=$('<div class="tv-ideas">').appendTo(a);this.$data=$('<div class="tv-ideas-data">').appendTo(this._$widget);this.listView=new TradingView.NotesWidget.ListView(this.$data);this._scroll=new Q59(this._$widget,this.$data);var b=this;this._scroll.scrolltoend.subscribe(this,function(a){this.notesCache.requestRunning()||this.notesCache.requestedAll()||b.appendData()});this.$addButton=$('<a class="button" title="Create new note..."><span class="icon icon-plus"></span></a>').on("click",
|
|
TradingView.Common.publishChart.bind(TradingView.Common,{isPrivate:!0})).appendTo(this.bridge.$headerspace);this.$addButton.on("click",function(a){a.preventDefault()});this.onChart()||this.$addButton.hide();this.$settingsButton=$('<a class="button" title="Settings"><span class="icon icon-config"></span></a>').on("click",function(a){this._showSettingsDialog(a)}.bind(this)).appendTo(this.bridge.$headerspace);TradingView.bindPopupMenu(this.$settingsButton,null,{event:"show-popup",hideEvent:"hide-popup",
|
|
careBottomBorder:!0,careRightBorder:!0,viewportSpacing:2,reverse:!0})};TradingView.NotesWidget.prototype._showSettingsDialog=function(a){if($(a.delegateTarget).hasClass("open"))return $(a.delegateTarget).trigger("hide-popup"),!1;new TradingView.NotesWidgetSettings(this.bridge,function(b,c){$(a.delegateTarget).trigger("show-popup",[b,c])},this.onChart());a.preventDefault();return!1};TradingView.NotesCache=function(a){this.requestData=a;this.offset=0;this.itemsInRequest=5;this.requestsRunning=0};
|
|
TradingView.NotesCache.prototype.requestRunning=function(){return 0<this.requestsRunning};TradingView.NotesCache.prototype.requestedAll=function(){return this.offset>=this.chartsCount};TradingView.NotesCache.prototype.addNote=function(){this.offset++};TradingView.NotesCache.prototype.removeNote=function(){this.offset--};
|
|
TradingView.NotesCache.prototype.requestNext=function(){var a=this;this.requestData.offset=this.offset;this.requestData.count=this.itemsInRequest;this.requestsRunning++;return $.get("/my-ideas/",this.requestData,function(b){b&&(a.offset+=b.charts.length,a.chartsCount=b.count)}).always(function(){a.requestsRunning--})};
|
|
TradingView.NotesWidget.prototype.getRequestData=function(a){a={start:a||0,onlyPrivate:this.showOnlyPrivateIdeas(),onlyFavorite:this.showOnlyFavoriteIdeas()};if(this.bridge.getChartWidget()){var b=this.bridge.symbol.value(),c=this.bridge.interval.value();b&&this.showIdeasForCurrentSymbol()&&(a.symbol=b);c&&this.showIdeasForCurrentResolution()&&(a.interval=c)}return a};
|
|
TradingView.NotesWidget.textEllipsis=function(a,b){for(var c=$(b).height();$(a).outerHeight()>c;)$(a).text(function(a,b){return b.replace(/\W*\s(\S)*$/,"...")})};TradingView.NotesWidget.Favorites=function(a){this.key=a;this._favs=TVSettings.getJSON(a,[])};TradingView.NotesWidget.Favorites.prototype.addFavorite=function(a){if(this.isFavorite(a))return!1;this._favs.push(a);this.save();return!0};
|
|
TradingView.NotesWidget.Favorites.prototype.toggleFavorite=function(a){this.isFavorite(a)?this.removeFavorite(a):this.addFavorite(a)};TradingView.NotesWidget.Favorites.prototype.isFavorite=function(a){return-1!=this._favs.indexOf(a)};TradingView.NotesWidget.Favorites.prototype.save=function(){TVSettings.setJSON(this.key,this._favs)};TradingView.NotesWidget.Favorites.prototype.removeFavorite=function(a){return this.isFavorite(a)?(this._favs.splice(this._favs.indexOf(a),1),this.save(),!0):!1};
|
|
TradingView.NotesWidget.Idea=function(a){this.$view=(new TradingView.NotesWidget.IdeaViewRenderer).render(a);this.$view.data("id",a.id);this.$view.data("imageUrl",a.image_url)};TradingView.NotesWidget.Idea.prototype.jqueryObject=function(){return this.$view};TradingView.NotesWidget.Idea.prototype.getName=function(){return this.$view.find(".name").text()};TradingView.NotesWidget.Idea.prototype.getImageUrl=function(){return this.$view.data("imageUrl")};TradingView.NotesWidget.Idea.prototype.getId=function(){return this.$view.data("id")};
|
|
TradingView.NotesWidget.Idea.prototype.setFavorite=function(a){this.$view.find(".favorite").toggleClass("active",a)};TradingView.NotesWidget.Idea.prototype.onClick=function(a){this.$view.on("click",function(b){b.stopPropagation();b.preventDefault();a(b,this)}.bind(this))};TradingView.NotesWidget.Idea.prototype.onDelete=function(a){this.$view.find(".delete").on("click",function(b){b.stopPropagation();b.preventDefault();a(b,this)}.bind(this))};
|
|
TradingView.NotesWidget.Idea.prototype.onFavorite=function(a){this.$view.find(".favorite").on("click",function(b){b.stopPropagation();b.preventDefault();a(b,this)}.bind(this))};TradingView.NotesWidget.Idea.prototype.onAdd=function(){TradingView.NotesWidget.textEllipsis(this.$view.find(".desc-wrap"),this.$view.find(".desc"))};TradingView.NotesWidget.IdeaViewRenderer=function(){};
|
|
TradingView.NotesWidget.IdeaViewRenderer.prototype.render=function(a){a={date:moment.unix(a.date_timestamp).format("D MMM, H:mm"),name:a.name,desc:a.desc,interval:a.interval,symbolStr:a.short_symbol+", "+a.interval,imageUrl:a.image_small,is_public:a.is_public};return $(Mustache.render('<div class="note-block"><div class="header">{{^is_public}}<div class="private-icon"></div>{{/is_public}}<div class="date">{{date}}</div><div class="separator"></div><div class="symbol">{{symbolStr}}</div><div class="separator"></div><div class="favorite"><span class="icon"></span></div></div>{{^is_public}}<span class="delete"></span>{{/is_public}}<div class="name">{{name}}</div><div class="desc"><div class="desc-wrap">{{desc}}</div></div><img class="preview" src="{{imageUrl}}"></div>',
|
|
a,TradingView.templates))};TradingView.NotesWidget.ListView=function(a){this.$list=a;this.showEmptyLabel()};TradingView.NotesWidget.ListView.prototype.empty=function(){this.$list.empty();this.showEmptyLabel()};TradingView.NotesWidget.ListView.prototype.loading=function(a){a?(a=$('<div class="spinner"></div>'),this.$list.append(a)):this.$list.find(".spinner").remove();this.showEmptyLabel()};
|
|
TradingView.NotesWidget.ListView.prototype.showEmptyLabel=function(){if(0==this.$list.children().length){var a=$('<div class="no-ideas">No ideas matched your criteria</div>');this.$list.append(a)}else this.$list.find(".no-ideas").remove()};TradingView.NotesWidget.ListView.prototype.prepend=function(a){this.$list.prepend(a.jqueryObject());a.onAdd();this.showEmptyLabel()};TradingView.NotesWidget.ListView.prototype.add=function(a){this.$list.append(a.jqueryObject());a.onAdd();this.showEmptyLabel()};
|
|
TradingView.NotesWidget.ListView.prototype.remove=function(a){this.$list.children().filterByData("id",a.getId()).remove();this.showEmptyLabel()};TradingView.NotesWidget.ListView.prototype.find=function(a){return this.$list.children().filterByData("id",a)};TradingView.NotesWidgetSettings=function(a,b,c){this._bridge=a;this._handler=b;this._handler(this.getMenu(c))};
|
|
TradingView.NotesWidgetSettings.prototype.getMenu=function(a){var b=[];b.push({title:"Favorite ideas",icon:{image:"url('/static/images/dialogs/checkbox.png')",offset:TVSettings.getBool(TradingView.NotesWidget.SHOW_ONLY_FAVORITE_IDEAS)?"0 -16px":void 0},action:function(a){this._bridge.postMessage(TradingView.NotesWidget.SHOW_ONLY_FAVORITE_IDEAS)}.bind(this)});b.push({title:"Only private ideas",icon:{image:"url('/static/images/dialogs/checkbox.png')",offset:TVSettings.getBool(TradingView.NotesWidget.SHOW_ONLY_PRIVATE_IDEAS)?
|
|
"0 -16px":void 0},action:function(a){this._bridge.postMessage(TradingView.NotesWidget.SHOW_ONLY_PRIVATE_IDEAS)}.bind(this)});a&&(b.push({title:"Ideas for the current symbol only",icon:{image:"url('/static/images/dialogs/checkbox.png')",offset:TVSettings.getBool(TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_SYMBOL)?"0 -16px":void 0},action:function(a){this._bridge.postMessage(TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_SYMBOL)}.bind(this)}),b.push({title:"Ideas for the current resolution only",
|
|
icon:{image:"url('/static/images/dialogs/checkbox.png')",offset:TVSettings.getBool(TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_RESOLUTION)?"0 -16px":void 0},action:function(a){this._bridge.postMessage(TradingView.NotesWidget.SHOW_IDEAS_FOR_CURRENT_RESOLUTION)}.bind(this)}));return b};var counter=0;
|
|
Q12=function(a){this._charWidgetCollection=a.getChartWidgetCollection();this.Z3=null;this._views=[];this._itemsBinding=[];this._headerBinding=[];this._boxBinding=[];this.$container=$('<div class="chart-data-window"></div>').appendTo(a.$body);this._scroll=new Q59(a.$body,this.$container);this.visible=a.visible.value();this._updateSource();this._upadateLayout();this._charWidgetCollection.activeChartWidget.subscribe(this.updateAll.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("Data Window")};
|
|
Q12.prototype._updateSource=function(){if(this.visible){this._views=[];this.Z3&&(this.Z3._dataWindowWidget=null);this.Z3=this._charWidgetCollection.activeChartWidget.value();this.Z3._dataWindowWidget=this;var a=this.Z3.model();if(a)for(var a=a.model().Z18(),b=0;b<a.size();b++){var c=a.item(b).dataWindowView();c&&this._views.push(c)}}};
|
|
Q12.prototype._upadateLayout=function(){if(this.visible){var a=this;this.$container.empty();this._itemsBinding=[];this._headerBinding=[];for(var b=this._boxBinding.length-1;0<=b;b--){var c=this._boxBinding[b];c.src.properties().visible.unsubscribe(a,c.visibilityHandler)}this._boxBinding=[];for(b=0;b<this._views.length;++b)c=this._views[b],c.items().size()&&function(b){var c=null;if(b instanceof SeriesDataWindowView)c=b._series;else if(b instanceof StudyDataWindowView||b instanceof
|
|
Q49)c=b.Z0;var f=$('<div class="box"></div>').appendTo(a.$container),g=b.header()?$('<div class="chart-data-window-header"><span class="text">'+b.header()+'</span><div class="hover-source-icon"></div></div>').appendTo(f):null;g&&a._headerBinding.push({value:b,$el:g.find(".text")});if(c&&g){var h=function(a){return(a?"Hide":"Show")+" data"},k=function(a){f.toggleClass("hidden",!a.value()).find(".toggle-source-icon").attr("title",h(a))};f.addClass("with-actions").toggleClass("hidden",
|
|
!c.properties().visible.value()).on("click",function(b){b.preventDefault();a.setSelectedSource(c)}).on("contextmenu",function(b){b.preventDefault();a.Z3.readOnly()||a.showContextMenuForSource(c,b)});g.on("dblclick",function(){(new EditObjectDialog(c,a.Z3.model())).show()}).append($('<div class="toggle-source-icon" title="'+h(c.properties().visible.value())+'"></div>').on("click",function(b){b.stopPropagation();b=c.properties().visible.value();a.Z3.model().setProperty(c.properties().visible,
|
|
!b,(b?"Hide ":"Show ")+c.title())}));c.properties().visible.subscribe(a,k);a._boxBinding.push({src:c,$el:f,visibilityHandler:k})}for(g=0;g<b.items().size();++g){var k=b.items().item(g),l=$('<div class="chart-data-window-item"></div>').appendTo(f);$('<div class="chart-data-window-item-title">'+k.title()+"</div>").appendTo(l);l=$('<div class="chart-data-window-item-value">'+k.value()+"</div>").appendTo(l);a._setValueHtml(l,k);a._itemsBinding.push({value:k,$el:l})}}(c);this.updateHighlight();this._scroll.resize()}};
|
|
Q12.prototype.update=function(){this.visible&&(this.updateHighlight(),this.updateValues())};
|
|
Q12.prototype.updateHighlight=function(a){var b=(a||{}).source;a=!!(a||{}).updateScroll;if(this.visible&&this.Z3&&this.Z3.model()){for(var c=this.Z3.model().hoveredSource(),b=b||this._charWidgetCollection.selectedSource.value(),d,e=0;e<this._boxBinding.length;++e){var f=this._boxBinding[e].src,g=this._boxBinding[e].$el;if(f){var h=!(!b||f!==b);this._boxBinding[e].$el.toggleClass("hover",!(!c||f!==c)).toggleClass("active",h);h&&(d=g)}}d&&a&&this._scroll.scrollTo(d)}};
|
|
Q12.prototype.updateValues=function(){if(this.visible){for(var a=0;a<this._itemsBinding.length;++a)this._setValueHtml(this._itemsBinding[a].$el,this._itemsBinding[a].value);for(a=0;a<this._headerBinding.length;a++)this._headerBinding[a].$el.html(this._headerBinding[a].value.header()).attr("title",this._headerBinding[a].value.title())}};Q12.prototype.updateAll=function(){this._updateSource();this._upadateLayout()};
|
|
Q12.prototype._onVisibilityChange=function(a){this.visible=!!a;a&&this.updateAll()};Q12.prototype._setValueHtml=function(a,b){var c=b.color(),d=this.prepareColor(c),c=c&&c!=d?'<div class="real-color" title="\u0421olor line" style="background-color:'+c+'"></div>'+b.value():b.value();a.html(c).css({color:d||""})};
|
|
Q12.prototype.prepareColor=function(a,b){if(a){var c=new RGBColor(b||"#FFFFFF");20>Math.abs(c.grayChannel()-(new RGBColor(a)).grayChannel())&&(a=c.blackWhiteContrast());return a}};Q12.prototype.setSelectedSource=function(a){this.Z3.model().setSelectedSource(a)};
|
|
Q12.prototype.showContextMenuForSource=function(a,b){a.hasContextMenu()&&(this.setSelectedSource(a),a.constructor===TradingView.Series?this._seriesContextMenu(a).show(b):isInherited(a.constructor,TradingView.Study)&&this._studyContextMenu(a).show(b))};
|
|
Q12.prototype._seriesContextMenu=function(a,b){var c=this.Z3.actions(),d=a.properties().visible.value(),d=[c.format,d?c.seriesHide:this.createActionShow(a)];a!=this.Z3.model().mainSeries()&&d.push(c.seriesRemove);return ContextMenu.createMenu(d)};
|
|
Q12.prototype._studyContextMenu=function(a,b){var c=this.Z3.actions(),d=a.properties().visible.value();return ContextMenu.createMenu([c.format,d?c.studyHide:this.createActionShow(a),c.studyRemove])};Q12.prototype.createActionShow=function(a){var b=new Action({checkable:!0,text:"Show",enabled:!0});b._binding=new Z13(b,a.properties().visible,this.Z3.model(),b.text);b._binding.setValue(a.properties().visible.value());return b};$(function(){var a=new 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;this.sendMessage=function(){var a=h.find('[name="message-text"]');(message=String(a.val()).replace(/^\s+|\s+$/g,""))?(widgetbar.setPage("Recent Chats"),TradingView.messagesWidget.sendMessageToUser(message,f.id),this.close()):a.css("border-color",
|
|
"#E0735E").focus()};this.isActiveTarget=function(a){return h&&g&&g.is(a)};this.isSameUser=function(a){return(a=a.data())&&f&&a.id==f.id};this.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(){e||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 l=$('<div class="ignore-ban-wrapper"></div>').appendTo(h.find(".content .username")),
|
|
u=!!user.ignore_list[f.id],z=f.is_moderator?null:$('<a href="#" class="ch-ignore-lnk'+(u?" active":"")+'">').text(u?"Unignore":"Ignore").click(f,function(a){a.preventDefault();u?$.post("/conversation-ignore/",{user_id:a.data.id,action:"remove"},function(b){b.error?Q83.showNotice("Error",b.error):(delete user.ignore_list[a.data.id],h&&(h.find(".ch-ignore-lnk").removeClass("active").text("Ignore"),u=!1))}):Q83.showConfirm("Confirm","Are you sure you want to ignore messages from "+a.data.username+
|
|
"?",function(){$.post("/conversation-ignore/",{user_id:a.data.id,username:a.data.username},function(b){b.error?Q83.showNotice("Error",b.error):user.ignore_list[a.data.id]=a.data.username})})}),s=!!f.is_banned,A=user.is_staff&&!f.is_moderator?$('<a href="#" class="ch-ban-lnk'+(s?" active":"")+'">').text(s?"Unban":"Ban").click(f,function(a){a.preventDefault();s?$.post("/conversation-ban/",{user_id:a.data.id,action:"unban"},function(a){a.error?Q83.showNotice("Error",a.error):h&&(h.find(".ch-ban-lnk").removeClass("active").text("Ban"),
|
|
s=!1)}):TradingView.messagesWidget.banUser(a.data.username,a.data.id)}):null;z&&z.appendTo(l);z&&A&&$("<span> | </span>").appendTo(l);A&&A.appendTo(l)}return this};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};this.open=function(){a();if(k||!h)return e&&h.css({top:0.45*$(window).height()+$(document).scrollTop(),left:""}),this;h&&jQuery.contains(document.body,h[0])||h.css("position","fixed").appendTo(document.body);var f=left=0,l=b("width"),f=b("height");e?(f=0.45*$(window).height()+$(document).scrollTop(),left=""):(f=g.offset().top-f,0>f-$(document).scrollTop()&&(f=g.offset().top+g.height()),left=g.offset().left-20,left+l>$(window).width()&&(left=$(window).width()-
|
|
l));h.css({position:"",top:f,left:left}).hide().fadeIn("fast",function(){e&&h.find('[name="message-text"]').focus()});k=!0;return this};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};this.isForm=function(){return e}},b;$(document).on("mouseenter",".userlink, .ch-userlink, .ch-item-userpic",function(){var c=$(this);if(a.isActiveTarget(c))a.open();else{var d="/u/"+(c.data("username")||c.text())+
|
|
"/info/",e={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, a.ch-item-message",function(){var b=$(this);runOrSignIn(function(){a.update(b).setForm().open()})})});Q60=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)};
|
|
Q60.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()};Q60.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)))})};
|
|
Q60.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)};
|
|
Q60.prototype.getPaneIndexById=function(a){for(var b=0;b<this._panes.length;b++)if(this._panes[b].id===a)return b;return null};Q60.prototype.getPaneById=function(a){a=this.getPaneIndexById(a);return null===a?null:this._panes[a]};Q60.prototype.highlightPane=function(a,b,c){this._panes[a].$header.highlight(b,c)};Q60.prototype.highlightWidget=function(a,b,c){this.highlightPane(this.getPaneIndexById(a),b,c)};
|
|
Q60.prototype.paint=function(){this._panes.forEach(function(a,b){a.widgetObject.paint&&a.widgetObject.paint()},this)};Q60.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())};
|
|
Q59=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){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())};Q59.prototype._defaultOptions={headerHeight:0,additionalClass:"",alwaysVisible:!1,showBottomShadow:!0};Q59.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};
|
|
Q59.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};
|
|
Q59.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};
|
|
Q59.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};
|
|
Q59.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))};
|
|
Q59.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()))}};
|
|
Q59.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()};
|
|
Q59.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};Q59.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};Q59.prototype.scrollToStart=function(){this.setContentTop(this._header_height);this._onScroll();return this};Q59.prototype.atStart=function(){return this._$content.position().top>=this._header_height};
|
|
Q59.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};
|
|
Q59.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())};Q59.prototype.save=function(){this._saved={top:this._$content.position().top,height:this._$content.height()};return this};
|
|
Q59.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};
|
|
Q59.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};
|
|
Q59.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};
|
|
Q59.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.Z4=b;this._readOnly=b.readOnly();this._savedCharts=[];this._editEnabled=!0;this._load=$('<span class="first button load">'+$.t("Load")+"</span>").click($.proxy(this,"loadMenu")).appendTo(a);this._title=$('<span class="title apply-common-tooltip"></span>');
|
|
c.hideChartTitle&&this._title.hide();this._sep=$("<i>").addClass("separator");this.loadChartDialog=new LoadChartDialog;this.renameChartDialog=new RenameChartDialog;this._optionsMenu=$('<span class="button with-arrow options last">').append($("<span>").addClass("arrow-icon")).click($.proxy(this,"otherActionsMenu"));TradingView.bindPopupMenu(this._optionsMenu,null,{direction:c.popupDirection,event:"button-popup",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()):(this._save=$('<span class="save button">'+$.t("Save")+"</span>").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")),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();this._refreshSavedChartsList();
|
|
loginStateChange.subscribe(this,this._refreshSavedChartsList);TVXWindowEvents.on("saved-charts-change",$.proxy(this._otherTabUpdated,this));TVXWindowEvents.on("saved-charts-change-favorites",$.proxy(this._favoritesUpdated,this));Q77.undoStack().onChange().subscribe(this,function(){if(!Q77.undoStack().isEmpty()){var a=Q77.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._load.click(),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);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=clean(this.Z4.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;D76.enabled("save_old_chart_before_save_as")&&this.Z4.metaInfo.id.value()&&this._saveChart();(new RenameChartDialog($.t("Copy Chart"))).show($.t("{0} copy").format(a.Z4.metaInfo.name.value())).then(function(b){D76.enabled("saved_charts_count_restriction")&&!user.is_pro&&5<=a._savedCharts.length?Q83.showGoProDialog({feature:"savedChartsLimit"}):D76.enabled("saveload_storage_customization")?
|
|
(a.Z4.metaInfo.uid.setValue(void 0),a.Z4.metaInfo.id.setValue(void 0),a.setTitle(b),a.saveChart()):window.open("/e/?clone="+a.Z4.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{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=3E4;TradingView.SaveLoadWidget.prototype.autosave=function(){D76.enabled("charts_auto_save")&&(this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=0),this._autosaveTimer=setTimeout(function(){this.Z4.metaInfo.id.value()&&this._saveChart()}.bind(this),this._autosaveInterval))};
|
|
TradingView.SaveLoadWidget.prototype._goChartPage=function(a){"/e/"==location.pathname&&(location="/e/"+a+(TradingView.isMobileView?"?mobile=1":""))};
|
|
TradingView.SaveLoadWidget.prototype.saveChart=function(){var a=this.getTitle();a?(this.Z4.metaInfo.name.setValue(a),this._saveChart(function(){TradingView.trackEvent("GUI","Save Chart");this._goChartPage(this.Z4.metaInfo.uid.value());"undefined"!=typeof TradingView.UaTitleManager&&TradingView.UaTitleManager.instance&&TradingView.UaTitleManager.instance.updateView();this._refreshSavedChartsList()}.bind(this),function(){this.Z4.metaInfo.name.setValue("");
|
|
this.setTitle("")}.bind(this))):TradingView.showChartNameDialog(function(a){this.setTitle(a);this.saveChart()}.bind(this),void 0,void 0,64)};TradingView.SaveLoadWidget.prototype.signInOrSaveChart=function(){D76.enabled("saveload_requires_authentication")?runOrSignIn($.proxy(this,"saveChart")):this.saveChart()};TradingView.SaveLoadWidget.prototype.saveChartByEnter=function(a){"13"==a.keyCode&&(this._titleInput.blur(),this.signInOrSaveChart())};
|
|
TradingView.SaveLoadWidget.prototype._refreshSavedChartsList=function(a){D76.enabled("saveload_requires_authentication")&&!is_authenticated?this._savedCharts=[]: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.Z4.metaInfo.id.value()&&(D76.enabled("saveload_storage_customization")?(this.Z4.clearChartMetaInfo(),this.setTitle(void 0)):location="/e/")};
|
|
TradingView.SaveLoadWidget.prototype._getSavedCharts=function(){var a=[];!this._readOnly&&this.isSaved()&&(a.push({title:$.t("Rename..."),action:this._renameChart.bind(this)}),a.push({title:$.t("Save As..."),action:this.cloneChart.bind(this)}));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:e.id==b.Z4.metaInfo.id.value(),openAction:function(){openSavedChart(e)},deleteAction:function(a){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.otherActionsMenu=function(){this._optionsMenu.hasClass("active")||this._optionsMenu.trigger("button-popup",[this._getSavedCharts()])};
|
|
TradingView.SaveLoadWidget.prototype.loadMenu=function(){if(D76.enabled("refresh_saved_charts_list_on_dialog_show")){var a=this;this._load.addClass("process");this._refreshSavedChartsList(function(){a._load.removeClass("process");a.loadChartDialog.show(a._getLoadMenuCharts(),a.favorites)})}else this.loadChartDialog.show(this._getLoadMenuCharts(),this.favorites)};Q9=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()};
|
|
Q9.prototype.init=function(){this._widget=$('<div class="control-bar-wrapper">').appendTo(this._parent);$('<div class="control-bar"><span class="move-left-button-control-bar"></span><span class="zoom-out-right-button-control-bar"></span><span class="turn-button-control-bar"></span><span class="zoom-in-button-control-bar"></span><span class="move-right-button-control-bar"></span></div>').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")}};
|
|
Q9.prototype.initToRealChart=function(){var a=this;this._back=$('<span class="back-to-present"></span>').appendTo(this._parent).addClass("hidden");this._back.on("click",function(){a._chart.model().timeScale().scrollToRealtime(!0);a._chart.model().model()._invalidateHandler(new Q22(Q22.FULL_UPDATE));a._back.addClass("hidden")});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)})};Q9.prototype.check=function(){this._chart.model()&&0>this._chart.model().timeScale().rightOffset()?this._back.removeClass("hidden"):this._back.addClass("hidden")};
|
|
Q9.prototype._move=function(a){"stop"==this._state&&this._chart.model().beginUndoMacro(1==a?"Move Left":"Move Right");this._state="moving";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)}};Q9.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};
|
|
Q9.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.currentDistance=this._movingTimeout=0,this._chart.model().endUndoMacro())}.bind(this),10);this._incrementInterval=0};
|
|
Q9.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())};
|
|
Q9.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._move.bind(this,1));this._buttons.moveLeft.on(c,this._stopMove.bind(this,1));this._buttons.moveRight.on(b,this._move.bind(this,-1));this._buttons.moveRight.on(c,this._stopMove.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()});a.withModel(this,function(){var b=function(){var b=!a.model().canZoomIn(),c=!a.model().canZoomOut();this.makeBtnDisabled(this._buttons.zoomIn,b);this.makeBtnDisabled(this._buttons.zoomOut,c)};a.model().onSimpleZoomIn().subscribe(this,function(){b.call(this)});a.model().onSimpleZoomOut().subscribe(this,function(){b.call(this)})});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:this._move.call(this,1);break;case 39:this._move.call(this,-1)}}.bind(this)).on("keyup",function(a){if(!$(a.target).closest("input, textarea").length)switch(delete d[a.which],a.which){case 37:case 39:this._stopMove.call(this)}}.bind(this))};
|
|
Q9.prototype.makeBtnDisabled=function(a,b){a instanceof $?a.toggleClass("disabled",!!b):"string"===typeof a&&(this._buttons[a]?this._buttons[a].toggleClass("disabled",!!b):console.warn("No btn "+a+" in ControlBarNavigation"))};Q9.prototype.resetButtons=function(){if(this._buttons)for(btnName in this._buttons)this._buttons[btnName].removeClass("disabled")};TradingView.SeriesControlWidget=function(){function a(a){var c=this,d=this.Z3=a.Z2;this._$seriesControls=$(document.createElement("div")).attr("class","chart-controls-bar-buttons chart-series-controls").appendTo(a.parent);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);
|
|
this._$extendedHoursButton=null;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")})});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);D76.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.Z3.Z4;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.Z3.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(){var a=this.Z3;if(a.model().mainSeries().status()!=TradingView.Series.STATUS_LOADING){var c=a._dateRangeResolutions();if(c.length){this._$dateRanges.empty();for(var d=0;d<c.length;d++){var e=c[d],f=$(document.createElement("a")).text(e.text);f.appendTo(this._$dateRanges);
|
|
f.click({val:e.value,res:e.targetResolution},function(c){a.model().loadRange(c.data)})}}}};a.prototype.updateExtendedHoursButton=function(){this._$extendedHoursButton&&(1440>this.Z3.model().mainSeries().properties().interval.value()?this._$extendedHoursButton.removeClass("disabled").toggleClass("active",!!this.Z3.model().mainSeries().extendedHours.value()).attr("title","Extended Hours"):this._$extendedHoursButton.removeClass("active").addClass("disabled").attr("title","Extended Hours are available for intraday only"))};
|
|
a.prototype.updateFullscreenChartButton=function(){var a=this.Z3.Z4;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}();Q69=function(){function a(b){if(!(this instanceof a))throw new TypeError("SymbolSearch is a constructor");this._inputParserMixin=D76.enabled("symbol_search_parser_mixin")?new Q70(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)},k=0;k<e.length;k++)if(e[k].immediate)$(this._inputElement).on(e[k].name,c);
|
|
else $(this._inputElement).on(e[k].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=Z15.supportedSymbolsTypes(),d=TVSettings.getValue("symboledit.filter");!c.some(function(a){return a.value===d})&&0<c.length&&(d=c[0].value);0!=c.length&&(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))}function c(a,b){var c=Z15.supportedExchangesList(),d=TVSettings.getValue("symboledit.exchangefilter");!c.some(function(a){return a.value===d})&&0<c.length&&(d=c[0].value);if(0!=
|
|
c.length){var e=$("<select>").appendTo(b);c.forEach(function(a){var b=a.value,c=a.name||b,f=a.desc||c,b=$("<option>").attr("value",b).text($.t(c)).data("custom-option-text",$.t(f)).appendTo(e);a.value===d&&b.attr("selected",!0)});e.change(function(){var b=$(this).val()||"";TVSettings.setValue("symboledit.exchangefilter",b);a.exchangeFilter(b)});e.selectbox({speed:0,classHolder:"tv-unstyled-select-container tv-symbol-select"});a.exchangeFilter(d)}}function d(a){return a.ctrlKey||a.metaKey||!a.charCode||
|
|
!a.which||32>=a.which||/^(input|textarea)$/i.test(a.target.tagName)||Q83.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"}];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){this._state.suggestOptions&&0!==this._state.suggestOptions.length&&(a=void 0===this._state.highlightIndex?0:Math.max(0,Math.min(this._state.highlightIndex+a,this._state.suggestOptions.length-
|
|
1)),this._highlightOption(a,!0))};a.prototype._onKeyDown=function(a){if(40===a.keyCode||38===a.keyCode)this._moveSelection(40===a.keyCode?1:-1),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.acceptTypeIn()};a.prototype._eventListener=
|
|
function(a){a=this._inputElement;var b=this._getInputValue().toUpperCase(),c=!1;this._state.value!==b&&(this._state.hasOwnProperty("value")&&this._onValueChanged&&this._onValueChanged(b),this._state.value=b,c=!0,this._inputParserMixin&&this._inputParserMixin.parse());this._fixIntervalCase();b=this._limitInputSelectionValue("selectionStart");this._state.selectionStart!==b&&(this._state.selectionStart=b,c=!0);b=this._limitInputSelectionValue("selectionEnd");this._state.selectionEnd!==b&&(this._state.selectionEnd=
|
|
b,c=!0);this._state.selectionDirection!==a.selectionDirection&&(this._state.selectionDirection=a.selectionDirection,c=!0);c&&(this._onSelectionChanged(),c=!1,this._getInputValue()!==this._state.value&&(this._setInputValue(this._state.value),c=!0),(c||this._state.selectionStart!==this._limitInputSelectionValue("selectionStart")||this._state.selectionEnd!==this._limitInputSelectionValue("selectionEnd"))&&a.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:this._inputElement[b]};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(){function a(c,d,e,f){b._state.contextTicker=c;b._state.contextExchange=d;b._state.contextType=e;b._state.keepListFor&&b._state.keepListFor===f||(b._getSuggestList(),delete b._state.keepListFor)}var b=this;if(this._inputParserMixin)this._inputParserMixin.onSelectionChanged(a);else{var c=this._state.value;a(c,this._state.exchangeFilter,this._state.typeFilter,this._state._selectedTicker||c)}};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();Z15.searchSymbolsByName(b,c,d,"undefined"!=typeof Z2?Z2: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(a){if(this.$list){var b=this,c=this._state;this._clearSuggestList();var d=c.suggestOptions=[],e=RegExpEscape(c.contextTicker).trim(),m=RegExp(e.replace(" ","|"),"i"+(1<e.length?"g":""));delete c.highlightIndex;this._hidePro&&(a=a.filter(function(a){return!a.params||
|
|
-1===a.params.indexOf("pro")}));if(0===a.length)this.$list.html('<div style="text-align: center; padding: 7px 0; font-style: italic;">'+$.t("No symbols matched your criteria")+"</div>");else{var q,n=$('<table class="symbol-edit-popup">').appendTo(this.$list);a.forEach(function(a,b){a.ticker||(a.ticker=a.full_name);d.push(a);var e=$('<tr class="symbol-edit-popup">');e.attr("data-index",b);var f=$('<td class="symbol-edit-popup-td name">');f.html(a.symbol.replace(m,"<strong>$&</strong>"));f.appendTo(e);
|
|
$('<td class="symbol-edit-popup-td desc">').html(m.test(a.symbol)?a.description:a.description.replace(m,"<strong>$&</strong>")).appendTo(e);f=$('<td class="symbol-edit-popup-td type">').appendTo(e);"undefined"!=typeof a.params&&~a.params.indexOf("eod")&&$("<i>").text("eod").addClass("eod").prependTo(f);switch(a.type){case "index":f.append($.t(a.type));break;default:f.append($.t(a.type)+" - "+a.exchange)}f.appendTo(e);e.appendTo(n);a.ticker===c.contextTicker&&a.exchange===c.contextExchange&&void 0===
|
|
q&&(q=b);a._$tr=e});void 0!==q&&this._highlightOption(q);n.on("click","tr",function(a){a.preventDefault();b._state.suggestOptions&&(a=b._state.suggestOptions[+this.getAttribute("data-index")])&&a.full_name&&b.accept(a.full_name,a.ticker)})}}};a.prototype._highlightOption=function(a,b){var c=this._state;c.highlightIndex!==a&&(void 0!==c.highlightIndex&&c.suggestOptions[this._state.highlightIndex]._$tr.removeClass("symbol-edit-popup-active"),c.highlightIndex=a,c.suggestOptions[a]._$tr.addClass("symbol-edit-popup-active"),
|
|
b&&this._replaceCurrentSymbol())};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(){var a=this._state;if(a.suggestOptions&&void 0!==a.highlightIndex){var b=a.suggestOptions[a.highlightIndex],c="",d=0;if(this._inputParserMixin){b=this._inputParserMixin.replaceCurrentSymbol(b);if(!b.ok)return;
|
|
c=b.newValue;d=b.newCaretPos;a.keepListFor=b.keepListFor}else c=b.symbol,d=c.length,this._state._selectedTicker=a.keepListFor=b.ticker||b.symbol;this._setInputValue(c);this._inputElement.setSelectionRange(d,d);this._eventListener()}};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(!Q83.get("Symbol Search")){var e=Q83.createDialog("Symbol Search",{hideTitle:!0,hideCloseCross:!0,dragHandle:".filter",width:"650px",content:TradingView.templates.dialogs.symbolSearch});Q83.positionDialog(e);var h=e.find(".tv-dialog-content").addClass("symbol-search-dialog"),
|
|
k=h.find(".results");k.mousewheel(function(a,b){var c=$(this);0<b?c.scrollTop(c.scrollTop()-15):c.scrollTop(c.scrollTop()+15)});var l=h.find("input").get(0);l.value=d.initialValue?d.initialValue:TVSettings.getValue("symboledit.dialog_last_entry","");l.selectionStart=l.selectionEnd=l.value.length;l.focus();if("undefined"!=typeof Q70){var m,q;d.ignoreInterval||(m=a.getInputValueGetter(l),q=a.getInputValueSetter(l));var n=Q70.addSpreadActions(h.find(".spread-actions"),
|
|
l,m,q)}m=new a({input:l,list:h.find(".results").get(0),callback:function(a,b){d.callback&&d.callback(a,b);Q83.destroy("Symbol Search")},onParse:n,ignoreInterval:d.ignoreInterval});h=h.find(".filter");b(m,h);h=$('<div class="exchange-filter">').appendTo(h);c(m,h);Q83.resizeContent(e.height(),k);Q83.applyHandlers(e);Q83.positionDialog(e);e.on("destroy",function(){TVSettings.setValue("symboledit.dialog_last_entry",l.value)});return e}};a.bindToInput=function(d,e){function h(){n&&
|
|
(A.removeListWrapper(),n.off(),n.remove(),n=null)}function k(a){a.preventDefault()}e=e||{};d=$(d).eq(0);var l=e.callback,m=null,q=null,n=null,t=void 0,u=e.spreadActions&&$(e.spreadActions).eq(0);if(u&&u.size()&&"undefined"!=typeof Q70){var z,s;e.ignoreInterval||(z=a.getInputValueGetter(d.get(0)),s=a.getInputValueSetter(d.get(0)));t=Q70.addSpreadActions(u,d.get(0),z,s)}var A=new a({input:d,onValueChanged:function(){if(!n){var a=
|
|
A,d=$('<div class="symbol-edit-popup">').appendTo(document.body),e=$('<div class="filter">').appendTo(d);b(a,e);var f=$('<div class="exchange-filter">').appendTo(e);c(a,f);var f=$('<div class="table-wrapper">').appendTo(d),g=$(a._inputElement),a=g.offset();leftOffset=Math.max(0,Math.min(a.left+0,$(window).width()-d.outerWidth()));d.css("left",leftOffset+"px");d.css("top",a.top+g.outerHeight()+1);var h=parseInt($(window).height(),10),e=e.outerHeight(),l=$(window).scrollTop(),g=g.height();f.css("maxHeight",
|
|
h-(a.top-l)-g/2-g-e+"px");n=d;A.bindListWrapper(f);n.on("focus","*",k);n.on("click","*",k);n.on("mousedown","*",k)}},callback:function(a,b){h();"function"===typeof q&&q(a,b)||("function"===typeof l&&l(a,b),"function"===typeof m&&m(a,b));e.clearAfterAccept&&d.val("");e.keepFocus?d.get(0).focus():d.get(0).blur();A.resetState()},hidePro:e.hidePro,autoFocus:e.autoFocus,onEmptyApply:e.onEmptyApply,onParse:t,allowMultipleSymbols:e.allowMultipleSymbols,ignoreInterval:e.ignoreInterval}),B=!1;d.on("focus",
|
|
function(a,b){B=!0;A._skipAutoFocus?delete A._skipAutoFocus:setTimeout(function(){B&&d.get(0).select()},0)});d.on("blur",function(a){B=!1;setTimeout(function(){B||h()},0)});if(e.syncWithChartWidget){var w=function(a){symbol=a&&Q45.seriesShortSymbol.value()||Q45.symbol.value()||"";d.val(symbol);A.resetState()};w(!0);Q45.seriesShortSymbol.subscribe(function(){w(!0)});m=function(a,b){a&&Q45.symbol.setValue(a);b&&Q45.interval.setValue(b)};
|
|
q=function(a,b){if(b)return!1;if(a===Q45.symbol.value()||a===Q45.seriesShortSymbol.value())return!0};d.on("keypress",function(a){27===a.keyCode&&(d.get(0).blur(),w(!1))});d.on("keydown",function(a){27===a.keyCode&&(d.get(0).blur(),w(!1))})}return A};a.isIntervalInit=function(a){return/[\d,]/.test(a)};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){b=a.parseIntervalValue(b);if(b.error)return!1;if(b.intraday)return Q45.intraday.value();
|
|
var c=Q45.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("Z2 is required");TradingView.keyboardBinder.pushBackListener("symbolEdit",function(b){d(b)&&(b.preventDefault(),b=String.fromCharCode(b.charCode),a.isIntervalInit(b)?(new ChangeIntervalDialog({callback:function(a){Q45.interval.setValue(a)}})).show(b):
|
|
a.showDialog({initialValue:b,callback:function(a,b){Q45.symbol.setValue(a);b&&Q45.interval.setValue(b)}}))})};return a}();function RenameChartDialog(a,b,c){this.title=a||$.t("Rename Chart");this.label=b||$.t("Enter a new chart name");this.maxlength=c||""}
|
|
RenameChartDialog.prototype.show=function(a){var b=$.Deferred(),c=Q83.createDialog(this.title),d=function(){var a=c.find('input[name="name"]'),d=a.val();d?(b.resolve(d),Q83.destroy(this.title)):(Q83.showError($.t("Please enter chart name"),Q83.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(){Q83.destroy(this.title)}.bind(this)).appendTo(c.find(".tv-dialog-right"));Q83.positionDialog(c,{left:$(window).width()/2-c.width()/2,top:$(window).height()/2-c.height()/2});Q83.applyHandlers(c);c.find('input[name="name"]').val(a).focus().select();
|
|
return b};function LoadChartDialog(){this.title=$.t("Load Chart");this.options={};this.inputDelegate=new Delegate;this.matchedItems=[];this.itemsData=[];this.qs=new LoadChartDialog.QuickSearch(this.inputDelegate,this.fieldsExtractor,this.searchResult.bind(this));this.sortObj=new LoadChartDialog.SortObject(this.modifiedCompare);this.nameSort=new LoadChartDialog.SortObject(this.nameCompare);this.symbolSort=new LoadChartDialog.SortObject(this.symbolCompare);this.toolsSort=new LoadChartDialog.SortObject(this.toolsCompare)}
|
|
LoadChartDialog.QuickSearch=function(a,b,c){this.fieldsExtractor=b;this.callback=c;this.regExps=[];a.subscribe(this,this.onInput)};LoadChartDialog.QuickSearch.prototype.onInput=function(a){this.query=a;this.createRegexps(a);this.search()};LoadChartDialog.QuickSearch.prototype.createRegexps=function(a){this.regExps=[];this.regExps.push(RegExp("("+a.split("").map(function(a){return RegExpEscape(a)}).join(")(.*?)(")+")","i"))};
|
|
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};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)};LoadChartDialog.QuickSearch.prototype.setItems=function(a){this.items=a};
|
|
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}};
|
|
LoadChartDialog.prototype.fieldsExtractor=function(a){var b=LoadChartDialog.symbolWrap(a);return[a.title,b]};LoadChartDialog.prototype.saveFavorite=function(a,b){b?this.favorites[a]=b:delete this.favorites[a]};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};LoadChartDialog.prototype.getFavorite=function(a){return this.favorites.hasOwnProperty(a)};
|
|
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(D76.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){a.openAction()}.bind(this))};
|
|
LoadChartDialog.prototype.removeItem=function(a){a=this.itemsData.indexOf(a);-1<a&&this.itemsData.splice(a,1);this.setChartsData(this.itemsData)};LoadChartDialog.prototype.modifiedCompare=function(a,b){var c=a.modified;return moment(b.modified).diff(moment(c))};LoadChartDialog.prototype.nameCompare=function(a,b){return a.title.localeCompare(b.title)};LoadChartDialog.symbolWrap=function(a){return""===a.symbol?"multiple charts":a.symbol+" "+a.interval};
|
|
LoadChartDialog.prototype.symbolCompare=function(a,b){return LoadChartDialog.symbolWrap(a).localeCompare(LoadChartDialog.symbolWrap(b))};LoadChartDialog.prototype.toolsCompare=function(a,b){var c=a.toolsCount,d=b.toolsCount;return c<d?-1:c==d?0:1};LoadChartDialog.prototype.sortClick=function(a){this.setSort($(a.target).data("sort"),!0);this.fillList()};
|
|
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")})};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)};
|
|
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)};LoadChartDialog.prototype.searchResult=function(a,b){this.matchedItems=a;this.fillList()};LoadChartDialog.prototype.updateChartsData=function(a){this.setChartsData(a)};LoadChartDialog.prototype.updateFavoritesData=function(a){this.favorites=a;this.itemsList&&this.inputDelegate.fire(this.input.val())};
|
|
LoadChartDialog.prototype.setChartsData=function(a){this.itemsList&&(this.itemsData=a,this.qs.setItems(a),this.inputDelegate.fire(this.input.val()))};
|
|
LoadChartDialog.prototype.layoutHeader=function(){var a=$('<div class="list-header">').appendTo(this.content);$('<div class="item name first">').text($.t("Chart 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};
|
|
LoadChartDialog.prototype.resetSort=function(){this.sortObj.reset();this.nameSort.reset();this.symbolSort.reset();this.toolsSort.reset();this.currentSortObj=this.sortObj};LoadChartDialog.prototype.resetSearchClick=function(){this.input.val("").trigger("input").focus()};
|
|
LoadChartDialog.prototype.show=function(a,b){this.options.width="654px";this.options.content='<div class="load-chart">'+(D76.enabled("new_chart_creation_available")?'<a class="button new-chart">NEW CHART</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=Q83.createDialog(this.title,this.options);Q83.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 Q59(this.itemsListContainer,this.itemsList,{showBottomShadow:!1});c.find(".new-chart").click(function(){open("/e/",
|
|
"_blank")});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;D76.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">You are not logged in. Please sign in.</a>').appendTo(d).click(function(a){a.preventDefault();Q83.destroy(this.title);Q83.showSignInDialog(null,{mode:"signin"})}.bind(this)));this.favorites=b;this.setChartsData(a);Q83.applyHandlers(c,{doNotCloseOnBgClickIfShadowbox:!0});var e=this.itemsListContainer;d&&(e=d);Q83.resizeContent(c.height(),e);Q83.positionDialog(c)};
|
|
LoadChartDialog.prototype.highlightOccurrences=function(a){this.itemsList.children(".item").each(function(){var b=$(this).find(".value.name").find("span"),c=b.text(),c=LoadChartDialog.highlightText(c,a);b.html(c);b=$(this).find(".value.symbol");c=b.text();c=LoadChartDialog.highlightText(c,a);b.html(c)})};
|
|
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}};function ChangeIntervalDialog(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")}
|
|
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))};
|
|
ChangeIntervalDialog.prototype._validate=function(){var a=this._input.val();this._parsed=Q69.parseIntervalValue(a);this._valid=!this._parsed.error;(this._supported=!this._parsed.error&&Q69.intervalIsSupported(a))&&(!this._parsed.unit||"H"==this._parsed.unit)&&1440<this._parsed.qty*("H"==this._parsed.unit?60:1)&&(this._supported=!1)};
|
|
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)};
|
|
ChangeIntervalDialog.prototype._handleInput=function(a){13===a.which?this._submit():a.ctrlKey||a.metaKey||!a.charCode||!a.which||32>=a.which||Q69.isIntervalChar(String.fromCharCode(a.charCode))||a.preventDefault()};
|
|
ChangeIntervalDialog.prototype._submit=function(){if(Q83.isOpen(this._dialogTitle)){if(this._valid&&this._supported){var a=Q69.sanitizeIntervalValue(this._input.val()),b=Q45.interval.value();a&&b!=a&&"function"==typeof this._options.callback&&this._options.callback(a)}this._helpTooltipTrigger.trigger("mouseleave");Q83.destroy(this._dialogTitle)}};
|
|
ChangeIntervalDialog.prototype._setInitialValue=function(a){a=a||this._options.initialValue;var b="",c=!1;a&&","!=a?b=Q69.sanitizeIntervalValue(a)||"":(b=a=Q45.interval.value(),c=!0);this._input.val(b);c&&this._input.select()};ChangeIntervalDialog.prototype.isValid=function(){return Boolean(this._valid)};
|
|
ChangeIntervalDialog.prototype.show=function(a){var b=Q83.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));Q83.applyHandlers(b);Q83.positionDialog(b);this._setInitialValue(a);this._validate();this._updateCaption();return b};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))}},
|
|
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))}}}();function clean(a){return a&&a.replace?a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):a}function cleanButAmpersand(a){return a&&a.replace?a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):a}function strip_tags(a){return a&&a.replace?a.replace(/(<([^>]+)>)/ig,""):a}function encodeSpread(a){return encodeURIComponent(a)}
|
|
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:clean,cleanButAmpersand: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;">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||Q83.showNotice("Oops, your browser can't display our charts!",'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>',"slim",
|
|
!0);!D76.enabled("websocket_connection")||"WebSocket"in window||swfobject.hasFlashPlayerVersion("9.0.0")||Q83.showNotice("TradingView Notice",'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>',
|
|
"slim",!0)});var loginStateChange=new Delegate;loginStateChange.subscribe(this,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){window._UNIT_TESTS||"undefined"===typeof _gaq||_gaq.push(["_trackEvent",a,b])};var assert=function(a,b){if(!a)throw Error("Assertion failed"+(b?": "+b:""));};
|
|
function changeLoginState(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);changeLoginState(!0);"function"==typeof Q83.onSigninSuccess&&(Q83.onSigninSuccess(),Q83.onSigninSuccess=void 0);Q83.modalDialog&&"Log in"==Q83.modalDialog.data("title")&&Q83.destroy()}
|
|
function signOut(){$.get("/accounts/logout/",function(){changeLoginState(!1)})}function runOrSignIn(a){is_authenticated?a():Q83.showSignInDialog(a)}function runOrGoPro(a,b){user&&user.is_pro?a():Q83.showGoProDialog(b)}function following(){runOrSignIn(function(){document.location="/following/"})}function followers(){runOrSignIn(function(){document.location="/followers/"})}function handleIfNotError(a,b){a.error?console.log(a.error):b(a)}
|
|
function handleIfNotErrorFunc(a){return function(b){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("Unfollow")}).on("mouseleave",".follow-big",function(){$(this).hasClass("unfollow")&&$(this).text("Following")})}
|
|
function bindIdeasStreamFilter(a,b){b=b||{};var c=a.find(".filter").map(function(){function a(d,f){var g=$(this),h=g.data("name");if(!0===s||s[h])d&&d.preventDefault();else{m&&z.find(".temp").remove();if(!is_authenticated&&g.hasClass("authorization-required"))return Q83.showSignInDialog(null,0),!1;var q=h?k.filter("[name="+h+"]"):k,u=g.data("value");if(q&&q.val()!=u||b.forceChange)t.filter(".active").filter(h?"[data-name="+h+"]":"*").removeClass("active").find(".active-underline").remove(),
|
|
g.addClass("active"),q.val(u).change(),f||"function"!=typeof b.onChange||setTimeout(function(){b.onChange(d,q.attr("name"),u)},0);var A=g.data("hook");if(A)for(key in A)c.forEach(function(a){-1<a.inputs.indexOf(key)&&a.obj.setValue(A[key],key)});m&&0==z.find("a[data-value="+u+"]").length&&g.clone(!0).addClass("temp item").append('<span class="active-underline"></span>').appendTo(z);!b.notPreventDefault&&b.onChange&&d&&d.preventDefault();if(!m){var K=t.filter(".active[data-filter-title]:first").data("filter-title")||
|
|
n;K?t.filter(".active").each(function(){K=K.replace("%"+$(this).data("name")+"%",$(this).contents(":first").text())}):K=g.contents(":first").text();l.text(K)}e(!0)}}function e(a){"boolean"!=typeof a&&(a=h);a?(g.stop(!0,!1).fadeOut(q),f.unbind("clickoutside").removeClass("active"),h=!1):(g.stop(!0,!1).fadeIn(q),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,q="undefined"==typeof b.speed?50:b.speed,n=f.data("filter-title");
|
|
f.find(".selected").on("click",e);g.on("click","a",a);var t=g.find("a"),u=f.parent(".filter-tabbed"),z;u.length&&(m=!0,z=u.find(".tabs"),t=t.add(z.find("a:not(.temp)")),z.on("click","a",a));var s={};f.find(".sub-group.inactive").find("a:first").each(function(a,b){s[$(b).data("name")]=!0}.bind(this));var A={setValue:function(b,c){var e=t.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?u.addClass("inactive "):f.addClass("inactive ");a||(b?("object"!=typeof s&&(s={}),s[b]=!0):s=!0)},enabled:function(a){a?($("[data-name="+a+"]",f).closest(".sub-group").removeClass("inactive"),"object"==typeof s&&(s[a]=!1)):(m?u.removeClass("inactive "):f.removeClass("inactive "),s=!1)}};f.data("interface",A);return{inputs:k.map(function(a,b){return $(b).attr("name")}).get(),obj:A}}).get()}bindProfileTabsFilter=bindIdeasStreamFilter;
|
|
Q18=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="/e/";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||this.$field.data("default-symbol");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=Q69.bindToInput(this.$field,$.extend((this.options||{}).symbolSearch,{callback:c,onEmptyApply:c}));var d=this};Q18.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=Q69.bindToInput(this.$field,{callback:function(a){a&&(a=a.toUpperCase(),location.href="/s/?q="+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))};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()}
|
|
function deleteChart(a,b){var c=[a];Q83.showConfirm($.t("Confirmation"),$.t("Are you sure you want to delete this chart?"),function(){if(D76.enabled("saveload_storage_customization"))return ChartsStorage.removeChart(a,b);$.post("/deletechart/",{uid:c},function(a){a.error||("string"===typeof b?document.location=b:"function"===typeof b?b():window.location.reload())})})}
|
|
function saveChart(a,b,c,d){if(D76.enabled("saveload_storage_customization"))return ChartsStorage.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));c()},d);$.post("/savechart/",a,function(a){"ok:"===a.substr(0,3)?(json=a.substr(3),res=JSON.parse(json),b.id.value()||(b.id.setValue(res.id),b.uid.setValue(res.uid)),"function"==typeof c&&c({uid:b.uid.value()},res.count||0)):"saved_chart_limit_reached"==a||""==a?("function"==
|
|
typeof d&&d(),Q83.showGoProDialog({feature:"savedChartsLimit"})):("function"==typeof d&&d(),$("#error").html(a));$(window).off("beforeunload.savechart")})}function openSavedChart(a){D76.enabled("saveload_storage_customization")?ChartsStorage.loadChart(a):open("/e/"+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;!isInteger(a)&&1<a&&(a=parseFloat(a.toString().replace(/^.+\./,"0.")));0<a&&1>a&&(b=Math.pow(10,a.toString().length-2));return b}var c=$('<div class="tv-ticker">').appendTo(this.parent());$('<div class="icon up">').appendTo(c);$('<div class="icon down">').appendTo(c);a=a||{};var d=parseFloat(a.step)||1,e=a.min,f=a.max,g=b(d);this.each(function(){function a(c){var e=isInteger(d)?parseInt(m.val(),10):parseFloat(m.val());isNaN(e)&&(e=0);var f=
|
|
b(e),f=Math.max(g,f);m.val(c(e,f));m.change()}function c(){a(function(a,b){var c=(Math.round(a*b)+Math.round(d*b))/b;void 0!==f&&null!==f&&f<c&&(c=a);return c})}function l(){a(function(a,b){var c=(Math.round(a*b)-Math.round(d*b))/b;void 0!==e&&null!==e&&c<e&&(c=a);return c})}var m=$(this);m.next().find(".up").click(function(){m.is(":disabled")||c()});m.next().find(".down").click(function(){m.is(":disabled")||l()});m.keydown(function(a){m.is(":disabled")||(38==a.keyCode?m.next().find(".up").addClass("active"):
|
|
40==a.keyCode&&m.next().find(".down").addClass("active"))});m.keyup(function(a){m.is(":disabled")||(38==a.keyCode?(c(),m.next().find(".up").removeClass("active")):40==a.keyCode&&(l(),m.next().find(".down").removeClass("active")))});m.mousewheel(function(a,b){0<b?m.next().find(".up").click():m.next().find(".down").click()})});return this};
|
|
function showDisconnectedMessage(){"MozWebSocket"in window&&WEB_SOCKET_WAS_CONNECTED?setTimeout("showDisconnectedMessageImpl()","15000"):showDisconnectedMessageImpl()}
|
|
function showDisconnectedMessageImpl(){TradingView.trackEvent("System","Disconnect");Q83.showNotice("Connection is lost",'<p class="tv-dialog-left">Connection to server was lost<br/><br/>How to fix:<ol class="tv-dialog-left"><li>Check firewall settings and make sure access to websocket ('+WEBSOCKET_HOST+" port "+WEBSOCKET_PORT+') is open. Then click Reconnect or press F5.</li><li>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="http://www.apple.com/safari/" target="_blank">Safari</a></li></ul></li><li>Server broke the connection. Click Reconnect or press F5.</li></ol></p><input class="tv-button xwide" type="button" value="Reconnect" onclick="Q83.destroy();"/>',
|
|
"",!0).on("destroy",function(){Z15.connect()})}function showCriticalErrorMessage(){TradingView.trackEvent("System","Critical Error");Q83.showNotice("Critical error appeared",'<input class="tv-dialog-button" type="button" value="Retry" onclick="Q83.destroy();"/>',"",!0).on("destroy",function(){Z15.connect()})}
|
|
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?"Neutral":"1"==c?"Long":"Short"}}function gotochart(a){location.href="/v/"+a+"/"}
|
|
$.fn.ellipsis=function(){return this.each(function(a,b){var c=$(this),d=c.text(),e=d,f=$(this.cloneNode(!0)).hide().css("position","absolute").css("overflow","visible").width(c.width()).height("auto");a=a||c.height();c.after(f);for(var g=f.height()-a;0<g;)e=e.substr(0,e.length-g),f.text(e+"\u2026"),g=f.height()-a;c.html(f.text());b&&d!=f.text()&&c.attr("title",d);f.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 a=(h.outerWidth()-d.outerWidth())/2,e=0,m=a+h.offset().left+d.outerWidth(),q=a+h.offset().left,n=document.body.clientWidth-5;5>q?e=5-q:m>n&&(e=n-m);a=h.offset().left+a+e;m=0;q="";"top"===f?(m=h.offset().top-d.outerHeight()-10,q="-=10"):"bottom"==f&&(m=h.offset().top+h.outerHeight()+10,q="+=10");d.css({left:a,top:m,opacity:0});b.css({left:Math.round(d.width()/2)-e});d.stop().animate({top:q,opacity:1},200)}}).off("mouseleave.tooltip").on("mouseleave.tooltip",function(a){d.addClass("blue-tooltip-hidden").removeClass(g)})})}})(jQuery);
|
|
$(function(){function a(d){if(!Modernizr.touch){var l=d.data("commonTooltipText"),m=d.attr("title");if(l)m&&(l=m,d.data("commonTooltipText",l),d.removeAttr("title"));else{if(!m)return;l=m;d.data("commonTooltipText",l);d.removeAttr("title");d.on("mouseleave mousedown",function(){clearTimeout(g);clearTimeout(h);jQuery.contains(document.body,e[0])&&(e.css("opacity","0"),h=setTimeout(e.detach.bind(e),c/2))})}m=jQuery.contains(document.body,e[0]);clearTimeout(g);clearTimeout(h);m?(f.text(l),b(d),e.css("opacity",
|
|
"1")):g=setTimeout(function(){e.appendTo(document.body);a(d)},c)}}function b(a){e.attr("class","common-tooltip-wrapper").css({top:"auto",right:"auto",bottom:"auto",left:"auto"});Modernizr.pointerevents||e.addClass("no-pointer-events");f.css({top:"auto",right:"auto",bottom:"auto",left:"auto"});var b=a.offset().top-$(window).scrollTop(),c=a.offset().left-$(window).scrollLeft(),g=a.outerWidth(),h=a.outerHeight(),t=$(window).width(),u=$(window).height();((a=a.hasClass("common-tooltip-vertical"))&&20>
|
|
g||!a&&20>h)&&e.addClass("farther");a?(e.addClass("vertical").css({left:c+g,top:b-(e.outerHeight()-h)/2}),f.offset().left+f.outerWidth()+d>t?e.addClass("otl").css({left:"auto",right:t-c}):e.addClass("otr")):(e.css({bottom:u-b,left:c-(e.outerWidth()-g)/2}),f.offset().top<d?e.addClass("below").css({bottom:"auto",top:b+h}):e.addClass("above"),0>f.offset().left-d?f.css("left",Math.abs(f.offset().left)+d):f.offset().left+f.outerWidth()+d>t&&f.css("left",t-(f.offset().left+f.outerWidth()+d)))}var c=500,
|
|
d=10,e=$("<div />").css("opacity","0"),f=$('<div class="common-tooltip-body" />').appendTo(e),g,h;$(document).on("mouseenter",".apply-common-tooltip",function(){a($(this))})});
|
|
Q17=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))};Q17.prototype.KEY="globalNotification";
|
|
Q17.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};Q17.prototype._setLastId=function(a){TVSettings.setValue(this.KEY,a)};
|
|
Q17.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}))};
|
|
Q17.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){if(D76.enabled("charting_library"))return function(a){"function"==typeof a&&a([]);return a};var b,c=!1,d=!1;return function(e){if(e||!c&&!d)d=!0,$.getJSON(a,function(a){d=!1;c=!0;b=a;"function"==typeof e&&e(a)});return b}};TradingView.getStudyTemplatesList=new TradingView.RequestCache("/study-templates-ext/");TradingView.getThemesList=new TradingView.RequestCache("/themes/");
|
|
function getImage(a,b){b=b||{};Q83.createModalDialog($.t("Image URL"));dialog=Q83.modalDialog;var c=dialog.find(".tv-dialog-content"),d=$("<p><img src="+TradingView.wrapUrl('"/static/images/loading-small.gif"')+"/></p>").css({textAlign:"center",position:"absolute",width:"100%"}).appendTo(c),e=$('<div class="main">').css({visibility:"hidden"}).appendTo(c),f=$("<a>").text($.t("Save image")).attr({target:"_blank"}).css("text-decoration","underline"),g=$("<input>").attr({type:"text",readonly:!0}).bind("click focus",
|
|
function(){this.select&&this.select()});$("<p>").appendTo(e).append(f," "+$.t("or copy url:"));$("<p>").appendTo(e).append($("<form>").append(g));var h=$('<p class="tv-dialog-socials">').appendTo(e);Q83.positionDialog();Q83.applyHandlers();TradingView.trackEvent("GUI","Get image button");takeSnapshot(a,function(c){c=D76.enabled("charting_library")?(b.snapshotUrl?"":"http://www.tradingview.com/x/")+c:window.location.protocol+"//"+window.location.host+"/x/"+c;c+="/";f.attr({href:c});
|
|
g.val(c);d.remove();e.css({visibility:"visible"});setTimeout(function(){var a=g.get(0);a.focus&&a.focus();a.select&&a.select()},0);c=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(h);$('<script src="//platform.twitter.com/widgets.js">\x3c/script>').appendTo(h)},function(){dialog.find(".tv-dialog-error").text("URL cannot be recieved.").show()},
|
|
{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);
|
|
if(is_authenticated){a||($(".header-item-profile strong.user-badge").remove(),$(".header-item-profile > a").append(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);$(".favorite_charts_count").html(user.favorite_charts_count);$(".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,b){b=$(b);var e=b.attr("rel");e&&b.attr("href",e.replace("%u",user.username))});if("undefined"!==typeof carouselModels)for(var b in carouselModels)carouselModels[b].reload();user.fastpass_script&&eval(user.fastpass_script);user.is_first_login&&(TradingView.trackEvent("Conversion","First login"),user.prort_trial_started&&(Q83.showTrialMessageSuccess(),
|
|
delete user.prort_trial_started),delete user.is_first_login);setTrialAvailiable(user.trial_availiable)}else user={username:"Guest",following:"0",followers:"0",ignore_list:{}},$(".user-info-username").html(user.username),window.localStorage&&localStorage.removeItem("trial_availiable");window.studyTemplates&&(studyTemplates.refreshStudyTemplateList(),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)}function followButtonToolipAll(){$(".follow-link").each(function(a,b){b=$(b);b.data("tv_tooltip")||followButtonTooltip(b)})}
|
|
function getSavedChartsList(a){return D76.enabled("charting_library")?ChartsStorage.getCharts(a):$.getJSON("/my-charts/",a)}function isOnChartEditPage(){return"/e/"==location.pathname.substr(0,3)}
|
|
function refreshChartMenuState(){var a=$("div.header-item-chart");a.length&&is_authenticated&&user.saved_charts?(a.addClass("with-sub"),a=a.find(".popup-subblock").eq(0),a.find("ul").remove(),getSavedChartsList(function(b){b={charts:b,has_charts:!0};a.append(Mustache.render(TradingView.templates.lists.savedCharts,b));var c=new Q59(a,a.find("ul").eq(0),{additionalClass:"gray",alwaysVisible:!0});a.parent().one("hover",function(){c.updateScrollBar()});isOnChartEditPage()&&
|
|
a.find(".new-chart").attr("target","_blank");a.find("li").slice(2).each(function(c,e){e=$(e);var f=e.find(".name").text();20<f.length&&e.attr("title",f);var g=b.charts[c].image_url;$("span.icon",e).click(function(b){a.mouseleave();deleteChart(g,function(){user.saved_charts--;var a=$(b.target).parent().attr("href");$(b.target).parent().parent().remove();!isOnChartEditPage()||user.saved_charts&&"/e/"+Z2.metaInfo().uid+"/"!=a?refreshChartMenuState():location.href="/e/"});return!1})})})):$("div.header-item-chart").removeClass("with-sub")}
|
|
function urlize(a){var b,c=[],d=0,e="";if(e=a.match(/(https:\/\/|http:\/\/)(www.tradingview.com|beta\d?.tradingview.com|webcharts\d?|localhost\:6285)\/(x|i)\/[0-9a-z]{8}\//gi))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>');
|
|
var f=a.match(/(https:\/\/|http:\/\/)(www.tradingview.com|beta\d?.tradingview.com|webcharts\d?|localhost\:6285)\/v\/[0-9a-z]{8}\//gi);if(f)for(b=0;b<f.length;b++)a=a.replace(f[b],"<"+d++ +">"),e=f[b].match(/\/v\/([0-9a-z]{8})\//i)[1],c.push('<div class="ch-item-chart-link"><i class="icon icon-snapshot-small" title="Published Idea"></i> <a href="'+f[b]+'" target="_blank" data-id="'+e+'">Published Idea</a></div><a target="_blank" href="'+f[b]+'" class="ch-item-chart-preview" data-id="'+e+'"><img src="'+
|
|
f[b].replace("/v/","/i/")+'" alt="" class="idea-preview"/></a>');if(e=a.match(/(http:\/\/|www\.|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(/(\$)[^0-9][a-z0-9\._-]{2,20}/gi))for(b=0;b<e.length;b++)a=a.replace(RegExp("\\"+e[b],"gi"),"<"+d++ +">"),c.push("<a target='_blank' href='/s/?q="+
|
|
e[b].substr(1)+"'>"+e[b]+"</a>");if(e=a.match(/\@[a-z0-9\._-\u00A0]{2,50}/gi))for(b=0;b<e.length;b++)a=a.replace(RegExp(e[b],"gi"),"<"+d++ +">"),c.push("<a target='_blank' href='/u/"+e[b].substr(1).replace("\u00a0"," ")+"/'>"+e[b]+"</a>");0<c.length&&(a=a.replace(/<(\d+)>/g,function(a,b){return c[b]?c[b]:""}));return 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);
|
|
function ShareTwitterSnapshot(a){function b(a,b){return"https://twitter.com/intent/tweet?&status="+encodeURIComponent(ShareTwitterSnapshot.getStatus(a,window.location.protocol+"//"+window.location.host+"/x/"+b+"/"))}if(TradingView.winMobileMode)this.onSuccess=function(c){try{JsBridge.sendEvent(b(a,c),"sharing_ready")}catch(e){}},this.onFailure=function(){try{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()}}}ShareTwitterSnapshot.getStatus=function(a,b){return TradingView.isCmeWidget?b+" from cmegroup.com via @tradingview $"+a:"$"+a+" chart "+b+" via http://www.tradingview.com"};
|
|
function ShareStocktwitsSnapshot(a){function b(a,b){return"https://stocktwits.com/widgets/share?body="+encodeURIComponent(ShareStocktwitsSnapshot.getStatus(a,window.location.protocol+"//"+window.location.host+"/x/"+b+"/"))}if(TradingView.winMobileMode)this.onSuccess=function(c){try{JsBridge.sendEvent(b(a,c),"sharing_ready")}catch(e){}},this.onFailure=function(){try{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()}}}ShareStocktwitsSnapshot.getStatus=function(a,b){return"$"+a+" chart "+b+" via http://www.tradingview.com"};
|
|
function authInStocktwits(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="+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}):""}
|
|
function userBadge(a,b,c){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,large_badge:!!b,badge_tag:c},TradingView.templates)}
|
|
TradingView.Common={publishChartWidget:function(a){runOrSignIn(function(){saver.publishChart(a)})},publishChart:function(a){runOrSignIn(function(){Q83.showPublishIntroDialog().done(function(){saver.publishChart(a)})})},createTrendingSymbols:function(){function a(a){function g(a,b){e[b]=a;quoteSessionMultiplexerInstance.simple.subscribe("trending_symbols_retry",[a],function(a){a.symbolname=b;h(a)})}function h(a){c[a.symbolname]||(c[a.symbolname]={});$.extend(c[a.symbolname],a.values);var b=c[a.symbolname],
|
|
d=$("#trending-symbols-item-"+TradingView.symbol2id(a.symbolname)+" .change");a=$("#trending-symbols-item-"+TradingView.symbol2id(a.symbolname)+" .last");var e=new PriceFormatter(b.pricescale||100,b.minmov||1,b.fractional,b.minmove2);a.text(e.format(b.last_price||""));0<b.change_percent?d.removeClass("minus").addClass("plus").text("+"+b.change_percent+"%"):0>b.change_percent?d.removeClass("plus").addClass("minus").text(b.change_percent+"%"):0==b.change_percent&&d.removeClass("plus minus").text(b.change_percent+
|
|
"%")}var k=d.splice(0,d.length);a.forEach(function(a){var c=$("#trending-symbols-item-"+TradingView.symbol2id(a.name));c.length?(c.attr("title",a.sessions+" watching "+a.short_name),c.find(".sessions-count").text(a.sessions)):c=$('<a class="trending-symbols-item clearfix" id="trending-symbols-item-'+TradingView.symbol2id(a.name)+'" title="'+a.sessions+" watching "+a.short_name+'" href="/chart/'+a.short_name+"/"+(a.full_name_required?"?exg="+a.exchange:"")+'" target="_blank"><div class="sessions"><span class="sessions-count">'+
|
|
a.sessions+'</span> <span class="icon icon-people-watching"></span></div><div class="symbol">'+a.short_name+'</div><div class="last"></div><div class="change"></div></a>').data("symbol",a.name);c.appendTo(b);d.push(a.name)});b.find(".trending-symbols-item").each(function(){-1==d.indexOf($(this).data("symbol"))&&$(this).remove()});a=[];for(var l=0;l<d.length;l++){var m=d[l],q=k.indexOf(m);-1===q?a.push(m):k.splice(q,1)}for(l=0;l<k.length;l++)m=k[l],quoteSessionMultiplexerInstance.simple.unsubscribe("trending_symbols",
|
|
m),e[m]&&(quoteSessionMultiplexerInstance.simple.unsubscribe("trending_symbols_retry",e[m]),delete e[m]);a.length&"eSessionMultiplexerInstance.simple.subscribe("trending_symbols",a,function(a){"permission_denied"==a.status?g(a.values.alternative,a.symbolname):h(a)});k=a=null}var b=$(".trending-symbols-table"),c={},d=[],e={};a(initialData.trendingSymbols);setInterval(function(){$.getJSON("/index/popular/",function(b){a(b)})},3E4)}};
|
|
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.")})),delete user.auth_token):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(){function a(){d=$.post("/quote_token/",null,"json").done(function(a){b.resolve(a)}).fail(function(){if(!b.isRejected()&&!b.isResolved()){var d=Math.min(1E3*c,3E4);c++;setTimeout(a,d)}})}var b=$.Deferred(),c=0,d;a();b.always(function(){d&&d.abort()});return b};
|
|
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||{};runOrSignIn(function(){$('<form action="/order/" 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)};
|
|
function hash(a){var b=0;if(0==a.length)return b;for(i=0;i<a.length;i++)code=a.charCodeAt(i),b=(b<<5)-b+code,b&=b;return b}function uniq(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)}}function debounce(a,b){var c;return function(){clearTimeout(c);c=setTimeout(a.bind.apply(a,[this].concat(Array.prototype.slice.call(arguments))),b)}}
|
|
function isLatin(a){return!/[^\u0000-\u00FF\u00A0\u2013-\u2122\u2200-\u23FF]/g.test(a)}function RegExpEscape(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}
|
|
function loadMorePeople(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=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='Followers'><a href='/u/{{ username }}/#followers'>{{ followers_count }}</a></span>\t\t\t<span class='user-stats-charts' title='Charts'><a href='/u/{{ username }}/#charts'>{{ charts_count }}</a></span>\t\t\t<span class='user-stats-reputation' title='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}}Unfollow{{/follow_status}}{{^follow_status}}Follow{{/follow_status}}' data-id='{{ id }}'>\t\t\t\t<span class='follow'>Follow</span>\t\t\t\t<span class='following'>Followed</span>\t\t\t\t<span class='unfollow'>Unfollow</span>\t\t\t</button> \t\t\t<button class='message-user message active' title='Send message' data-id='{{ id }}' data-username='{{ username }}'><span class='message'>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?"Unfollow":"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 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)})})}
|
|
function makeTextContainerEditable(a,b,c){function d(b){a.removeClass("tv-editable-active").on("click",function(){f(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(c){var f={okButtonText:$.t("OK"),okButtonClass:"tv-button ok",cancelButtonText:$.t("Cancel"),cancelButtonClass:"tv-button cancel"};c=$.extend({},f,c);var k=a.text(),f=Modernizr.touch?"":k,l="textarea"===c.replaceWith?$("<textarea"+
|
|
(c.inputClass?'class="'+c.inputClass+'" ':"")+"></textarea>"):$('<input type="text" '+(c.inputClass?'class="'+c.inputClass+'" ':"")+'value="">');l.val(f);var f=$('<div class="buttons"></div>'),m=$('<div class="'+c.okButtonClass+'">'+c.okButtonText+"</div>").appendTo(f),q=$('<div class="'+c.cancelButtonClass+'">'+c.cancelButtonText+"</div>").appendTo(f);e(k);var n="function"===typeof c.onCancel?function(){c.onCancel();d()}:function(){d(k)},t=function(a,c,e){/^\s+$/.test(c)&&(c="");l.attr("disabled",
|
|
"disabled");m.addClass("process");b(a,c,e,function(){d()})};m.click(function(b){b.preventDefault();b.stopPropagation();t(a,l.val(),k)});q.click(function(a){a.preventDefault();a.stopPropagation();n()});l.keyup(function(b){b.preventDefault();b.stopPropagation();13!=b.keyCode||b.shiftKey?27==b.keyCode&&n():t(a,l.val(),k)});a.empty().append(l,f);l.select()}!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")}
|
|
function changeUserProfileField(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,Q13.isProd()?
|
|
"Sorry, an error has occurred":c.responseText)}).always(function(){b(a.onComplete)})}else console.warn("Required options.name and options.value")}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(){Q83.showChangeUserStatusDialog()});return!1};
|
|
TradingView.getUrlParams=function(){for(var a,b=/\+/g,c=/([^&=]+)=?([^&]*)/g,d=window.location.search.substring(1),e={};a=c.exec(d);)e[decodeURIComponent(a[1].replace(b," "))]=decodeURIComponent(a[2].replace(b," "));return e};function setTrialAvailiable(a){window.localStorage&&(window.localStorage.trial_availiable=a?1:0)}function translatedIntervalString(a){var b=(""+a).match(/(.*)([DWM])/);return b?b[1]+$.t(b[2],{context:"dates"}):a}
|
|
function capitalizeFirstLetter(a){return a.charAt(0).toUpperCase()+a.slice(1)}TradingView.formatDollarValue=function(a){a=a.toFixed(2);return 0<=a?"$"+a:"-$"+Math.abs(a)};function generateColor(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";}function makeFont(a,b,c){return c+" "+a+"px "+b}
|
|
$.fn.filterByData=function(a,b){return this.filter(function(){return $(this).data(a)==b})};
|
|
window.adPack=function(){function a(a){if("object"!=typeof a||null===a)a=user;return a.username===d}function b(a){a.removeClass("settings").addClass(h);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(){row=$(this);if(!row.hasClass("error-row"))if(row.hasClass("caption")||
|
|
!a.fields.length)row.remove();else{var b=a.fields.shift(),c=row.find("td");c.eq(0).text(b.charAt(0).toUpperCase()+b.substr(1));$(document.createElement("textarea")).attr({name:b,maxLength:Math.pow(2,8),rows:10,cols:40}).appendTo(c.eq(1).html(""))}});a.sbmText&&c.find("input[type=submit]").attr("value",a.sbmText);c.appendTo(a.parent)}});return a}var c=customChatMessageActive=chartPopUpActive=profileTabActive=sendMassPMActive=!1,d="Exante",e="chart-ads-popup-counter-"+d,f="chart-ads-popup-disabled-"+
|
|
d,g,h="ad-pack";$(function(){c=TradingView.Z17("adPackActive");customChatMessageActive=TradingView.Z17("adPackCustomChatMsgActive");chartPopUpActive=TradingView.Z17("adPackChartPopUpActive");sendMassPMActive=TradingView.Z17("adPackMassPMActive");profileTabActive=TradingView.Z17("adPackProfileTabActive");c&&$(document.documentElement).addClass("sp-active")});return{isAdvertiser:a,customChatMessage:function(b,e){c&&customChatMessageActive&&
|
|
a(b)&&e(d.toLowerCase())},chartPopUp:function(a){if(c&&chartPopUpActive&&!user.is_pro){var b=~~localStorage.getItem(e),h=~~localStorage.getItem(f);if(!(3<=b||h)){var q,n;a.model().mainSeries().onSymbolResolved().subscribe(null,function(){g||q||(q=setTimeout(function u(){q=null;if(n){var c=a.model().mainSeries().quoteData;c&&(c=n[c.type]||n["default"],String(c).replace(/^\s+|\s+$/g,"")&&(g=Q83.createDialog("adPackExante",{addClass:"popup-"+d.toLowerCase(),content:'<div class="message">'+c.replace(/</g,
|
|
"<").replace(/>/g,">")+'</div><div class="actions-block"><a class="no-button">No, thank you</a><a href="https://exante.eu/?utm_source=tradingview" class="yes-button" target="_blank">Read more</a></div>',hideTitle:!0}),g.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(e,b+1)):a.hasClass("yes-button")&&(TradingView.trackEvent("AdPack",
|
|
"Exante-Popup-Accept"),localStorage.setItem(f,1));Q83.destroy("adPackExante");g=null}),Q83.positionDialog(g),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):(n=a,u())})},9E5))},!0)}}},setTab:function(c){if(a()&&profileTabActive&&c){var d=c.$decks.filter(".settings"),e=c.$tabs.filter("a[href=#settings]");d&&e&&(d=b(d.clone()).insertAfter(d),
|
|
e=e.closest(".filter-tabbed"),e=e.clone().insertAfter(e).find(".profile-tab"),e.text("Ad Pack").attr("href","#"+h).attr("data-value",h),c._tabsList[h]={showForNotAuth:!1},c.$tabs=c.$tabs.add(e.get(0)),c.$decks=c.$decks.add(d.get(0)))}}}}();Z16=new function(){this._delegates={};this._delegateByName=function(a){this._delegates.hasOwnProperty(a)||(this._delegates[a]=new Delegate);return this._delegates[a]};this.subscribe=function(a,b){this._delegateByName(a).subscribe(null,b)};this.emit=function(a,b){this._delegateByName(a).fire(b)}};var TVSettings=function(){function a(a,b){var c;c=z[a];!window.is_authenticated&&null==c&&window.localStorage&&(c=z[a]);return null==c?b:c}function b(a,b){strValue=""+b;z[a]!==strValue&&(z[a]=strValue,f(a));return this}function c(a){delete z[a];f(a);return this}function d(){A=void 0;!B&&s.length&&(g(),B=setTimeout(e,t))}function e(){B=void 0;s.length&&!A&&d()}function f(a){if(window.is_authenticated)s.push(a),A&&clearTimeout(A),A=setTimeout(d,n);else try{null==z[a]?localStorage.removeItem(u+"."+a):
|
|
localStorage.setItem(u+"."+a,z[a])}catch(b){}TVXWindowEvents.emit("settings",JSON.stringify({key:a,value:z[a]}))}function g(){if(window.is_authenticated&&0!==s.length){var a=s;s=[];for(var b={},c=a.length;c--;){var d=a[c],e=z[d];void 0===e&&(e=null);b[d]=e}$.post("/savesettings/",{delta:JSON.stringify(b)},function(a){}).fail(function(){})}}function h(){return Object.keys(z)}var k=!1;try{k=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(l){}if(k){var m={"widgetbar.layout-settings":{widgets:{},
|
|
settings:{minimized:!0}},notShowMainWizard:!0},k=function(a,b,c){a=m[a];return null===a||void 0===a?b:a},q=new Function;return{loaded:!1,loadedModel:!1,getValue:k,getJSON:k,getBool:k,getFloat:k,getInt:k,setValue:q,setJSON:q,remove:q,restoreDefaults:q,keys:function(){return Object.keys(m)},keysMask:function(){return[]},sync:q}}var n=500,t=5E3,u="tradingview",z={},s=[],A,B;TVXWindowEvents.on("settings",function(a){a=JSON.parse(a);null==a.value?delete z[a.key]:z[a.key]=a.value});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 this},remove:c,restoreDefaults:function(){for(var a=0;a<localStorage.length;a++){var b=localStorage.key(a);b.substring(0,u.length+1)===u+"."&&(s=[],localStorage.removeItem(b))}$.post("/restoredefaults/",{},function(a){Q83.showNotice("Success","Defaults has been successfully restored")}).error(function(a){})},keys:h,keysMask:function(a,b){var c=h(b),d=[];a=RegExp("^"+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){a=a||{};z=[];if(window.localStorage)for(var c=0===Object.keys(a).length,d=u+".",e=localStorage.length;e--;){var f=localStorage.key(e);if(f.substring(0,d.length)===d){if(c){var g=f.substring(d.length);b(g,localStorage.getItem(f))}localStorage.removeItem(f)}}for(e in a)z[e]=a[e]+""}else if(z=[],window.localStorage)for(e=u+".",a=localStorage.length;a--;)c=
|
|
localStorage.key(a),c.substring(0,e.length)===e&&(d=c.substring(e.length),z[d]=localStorage.getItem(c))}}}();Q13=function(){if("www.tradingview.com"==location.host||"dwq4do82y8xi7.cloudfront.net"==location.host||location.host.match(/proxy\d.tradingview.com/))return"battle";if("beta.tradingview.com"==location.host||"beta2.tradingview.com"==location.host)return"staging";if(location.host.match(/webcharts/))return"staging_local";location.host.match(/^localhost(:\d+)?$/);return"local"};Q13.isLocal=function(){return"local"==this()};
|
|
Q13.isProd=function(){return"battle"==this()};Q13.isDebug=function(){return!this.isProd()};TradingView.LOGLEVEL_NORMAL=1;TradingView.LOGLEVEL_DEBUG=2;Q46=[];TradingView.LOGHISTORY_LENGTH=50;TradingView.getLogLevel=function(){return TVSettings.getInt("log_level",TradingView.LOGLEVEL_NORMAL)};TradingView.loggingOn=function(){TVSettings.setValue("log_level",TradingView.LOGLEVEL_DEBUG);TradingView.logNormal("Debug logging enabled")};TradingView.loggingOff=function(){TVSettings.setValue("log_level",TradingView.LOGLEVEL_NORMAL);TradingView.logNormal("Debug logging disabled")};
|
|
TradingView.log=function(){var a;setInterval(function(){a=null},1E3);return function(b,c){c!=a&&("\n"!=c&&Q46.unshift(c),Q46.length>TradingView.LOGHISTORY_LENGTH&&Q46.pop(),"undefined"!==typeof console&&console.log&&b<=TradingView.getLogLevel()&&(a=c,console.log(c)))}}();TradingView.logNormal=function(a){TradingView.log(TradingView.LOGLEVEL_NORMAL,a)};TradingView.logDebug=function(a){TradingView.log(TradingView.LOGLEVEL_DEBUG,a)};
|
|
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(Q13.isProd()&&"undefined"!==typeof console){var noop=function(){};TradingView.remoteDebug=noop};(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";var l=null;if(h.hasClass("two-columns-item")){e.columns.sort(TradingView.sortMultipleFunction("index"));if(2<this.columnsCount)for(var l=null,m,h=this.columns.length-1;0<h;h--){var q=Math.abs(this.columns[h].height-this.columns[h-1].height);if(null===l||q<=l)l=q,m=h-1}else m=0;l=this.columns[m];m=this.columns[m+1];h=
|
|
k;q=0;l.height>m.height?h+=l.height-m.height:q=m.height-l.height;var n=document.createElement("div");n.style.height=h+"px";n.className="empty-space";m.fragment.appendChild(n);m.height+=h;q&&(n=document.createElement("div"),n.style.height=q+"px",n.className="empty-space",l.fragment.appendChild(n),l.height+=q)}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);Q83={modalDialog:null,dialogs:[],messageInterval:null,messageDelay:4E3,NOTIFICATION_ANIMATION_START_OFFSET:"-33px",_constrainDraggableOptionsIfNeeded:function(a){D76.enabled("constraint_dialogs_movement")&&(a.containment=".chart-page");return a},showIntervalMismatchDialog:function(a){var b;b=!1;Q83.createModalDialog("Interval is not applicable");var c=Q83.modalDialog;c.css({zIndex:1E3});c.find(".tv-dialog").css("width","400px");c=Q83.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(){Q83.destroy()});Q83.positionDialog();Q83.applyHandlers(!1,{doNotCloseOnBgClickIfShadowbox:b})},showSignInDialog:function(a,b){function c(a){switch(a){case "signup":case "register":break;case "signup-trial":a="signup-trial";break;case "recover":a="recover";break;default:a="signin"}d.find('[name="signup_trial"]').val("signup-trial"==
|
|
a?1:0);d.find(".show-if-signin, .show-if-signup, .show-if-recover, .show-if-signup-trial").not(".show-if-"+a).hide();d.find(".show-if-"+a).show().find("input:eq(0)").focus();Q83.positionDialog()}if(!is_authenticated){"function"==typeof a?Q83.onSigninSuccess=a:delete Q83.onSigninSuccess;Q83.createModalDialog("Log in",{noHeader:!0,addClass:"auth-dialog",appearance:"flat"});var d=Q83.modalDialog.find(".tv-dialog-content");d.html(TradingView.templates.dialogs.auth);c(b&&
|
|
b.mode);d.find(".recover-link").on("click",function(a){c("recover");a.preventDefault()});d.find(".signup-link").on("click",function(a){c("signup");a.preventDefault()});d.find(".signin-link").on("click",function(a){c("signin");a.preventDefault()});d.find(".auth-dialog-field").each(function(){function a(){c.toggleClass("empty",!c.val());d=!1}var b=$(this).find(".auth-dialog-field-placeholder"),c=$(this).find("input"),d=!1;a();c.on("blur",function(){b.toggleClass("disabled",!!this.value)});c.on("keypress keydown keyup input paste",
|
|
function(){d||(d=!0,setTimeout(function(b){a()},0))})});"stocktwits google facebook twitter linkedin yahoo".split(" ").forEach(function(a){var c="/accounts/signin/"+a+"/";d.find(".auth-dialog-social-"+a).on("click",function(a){b&&"signup-trial"==b.mode&&$.cookie("will_start_trial",1,{path:"/"});a.preventDefault();window.open(c,"_blank")})});d.find("#signin-form").on("submit",function(a){a.preventDefault();var b=$(this).find('[type="submit"]').addClass("process");Q83.submit(function(a){""!==
|
|
a.error?Q83.showError("Error: "+a.error):(Q83.destroy(),user=a.user,changeLoginState(!0),"function"==typeof Q83.onSigninSuccess&&(Q83.onSigninSuccess(),delete Q83.onSigninSuccess),"undefined"!==typeof next&&next&&(location.href=next));b.removeClass("process")},this)});d.find("#signup-form").on("submit",function(a){var b=this;a.preventDefault();var c=$(b).find('[type="submit"]').addClass("process");Q83.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)$(b).find("input[name^="+d+"]").addClass("error").data("error",a.errors[d][0]);$(".tv-dialog input.error").first().focus();Q83.showError($(".tv-dialog input.error").first().data("error"))}else Q83.showError("Error: "+a.errors);else Q83.showNotice("Activate Your Account",a.message);c.removeClass("process")},b)});d.find("#recover-form").on("submit",function(a){a.preventDefault();
|
|
var b=Q83.modalDialog;Q83.submit(function(a){""!==a.error?Q83.showError("Failed: "+a.error):(Q83.showMessage("New password is sent to your email."),setTimeout(function(){Q83.modalDialog===b&&Q83.destroy()},Q83.messageDelay))},this)});Q83.positionDialog();Q83.applyHandlers(null)}},showPublishIntroDialog:function(a){var b=$.Deferred(),c=TVSettings.getBool("publish.showIntroText",!0);if(a||c){a=Q83.createDialog("Please read before publishing");
|
|
var d=!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(Q83._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(){Q83.destroy("Please read before publishing");b.resolve()});a.on("destroy",function(){d=
|
|
!0;setTimeout(b.resolve,0)});b.always(function(){d||Q83.destroy("Please read before publishing")});Q83.positionDialog(a);Q83.applyHandlers(a)}else b.resolve();return b},showPublishChartDialog:function(a){function b(){e.find(".publish-related").tvtags("extractTags");var b={name:e.find('[name="name"]').val(),description:e.find('[name="description"]').val(),direction:e.find('input[name="direction"]').val(),is_public:"1"};a.onWidget||(b.tags=e.find(".publish-tags").tvtags("extractTags").tvtags("tagsWithPending").join(","),
|
|
b.twitter=e.find('input[name="twitter"]').is(":checked")?"1":"",b.stocktwits=e.find('input[name="stocktwits"]').is(":checked")?"1":"",b.is_public=e.find('input[name="public"]').is(":checked")?"1":"",b.related_charts=e.find(".publish-related").tvtags("extractTags").tvtags("tagsWithPending").join(","),b.chat=e.find('input[name="chat"]').is(":checked")?"1":"");a.publishSource&&(b.publish_source=a.publishSource);var c={onWidget:a.onWidget,publishAllLayout:e.find('[name="publish_entire_layout"]').is(":checked")};
|
|
if(!b.name.trim())Q83.showError("Chart title is required",e),e.find('[name="name"]').focus();else if(!b.description.trim())Q83.showError("Chart description is required",e),e.find('[name="description"]').focus();else if(!isLatin(b.name)||!isLatin(b.description))Q83.showError(l);else if(!isLatin(b.tags))Q83.showError("Please use only English in tags");else if(a.onPublish)a.onPublish(b,c)}function c(){e.show();var b=TVSettings.getJSON("publishchart.size",{w:t,h:u});e.height(Math.max(Math.min(b.h,
|
|
0.9*$(window).height()),u));e.width(Math.max(Math.min(b.w,0.9*$(window).width()),t));k();Q83.positionDialog(e);if(a.onShow)a.onShow()}function d(){e.hide();if(a.onMinimize)a.onMinimize()}var e=Q83.createDialog("Publish Idea",{addClass:"publish-dialog",hideCloseCross:!0});e.css("width","700px");var f=e.find(".tv-dialog-content");f.html(Mustache.render(a.onWidget?TradingView.templates.dialogs.publishChartWidget:TradingView.templates.dialogs.publishChart,user));var g=e.find(".tv-dialog-title"),
|
|
h=$('<a class="tv-dialog-title-minimize"></a>').appendTo(g);$('<span class="tv-dialog-readbefore"><a>Read before publishing</a></span>').appendTo(g);e.draggable(Q83._constrainDraggableOptionsIfNeeded({handle:g}));var k=function(){var a=f.find('textarea[name="description"]'),b=e.find(".tv-dialog-title").outerHeight();f.children(".main, *[class^=main-]").eq(0);return function(){a.css("height",e.height()-b-f.height()+a.height())}}();e.on("resize",function(a){a.stopPropagation();a.preventDefault();
|
|
k()});var l="TradingView is only for English-language content at this time.";$("#publish-chart-form").submit(function(a){a.preventDefault();b()});$("#publish-dialog-do-publish").click(function(a){a.preventDefault();b()});e.find('input[name="public"]').on("change",function(a){$(this).is(":checked")||(m.prop("checked",!1).change(),q.prop("checked",!1).change())});var m=e.find('input[name="twitter"]'),q=e.find('input[name="stocktwits"]');m.change(function(){m.is(":checked")&&(user.has_twitter||window.open("/accounts/permission/twitter/",
|
|
"twitter_permission_request","scrollbars=yes,height=400,width=700").focus())});q.change(function(){q.is(":checked")&&authInStocktwits()});f.on("mousedown",".publish-direction-buttons .tv-button",function(){var a=$(this);$(".publish-direction-buttons .tv-button").removeClass("active");a.addClass("active");e.find('input[name="direction"]').val(a.data("val"))});e.find(".tv-dialog-readbefore a").on("click",function(a){a.preventDefault();Q83.showPublishIntroDialog(!0)});a.isPrivate&&e.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(/([0-9A-Za-z-]+)\/?$/.exec(a)||0)[1]}var d={},f=e.find(".publish-related");a.related&&f.val([].concat(a.related).join(","));f.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",k)})();e.find(".publish-tags").tvtags("init",{keys:["\n",",",/\s/,";"],separator:",",addClass:"no-arrow with-ears",format:function(a){return{str:a.str,addClass:"tag"}},suggest:function(a,b){a||b(null);$.ajax("/tags-json/",{data:{search:a},dataType:"json"}).done(function(a){b(a)}).error(function(){b(null)})},maxLength:64}).on("change",
|
|
k);var n=[];a.Z5&&function(){function b(){var a=h.value().model();return a?(a=a.mainSeries(),(a.properties().shortName.value()||a.symbol())+" ("+a.interval()+")"):"Active Chart"}function c(){d.toggleClass("hidden",!("s"!==g.value()&&!k.value()));q.is(":checked")?(t.text("All Charts"),m.attr({"class":"tv-dialog-layout-button tv-dialog-layout-"+g.value()})):(t.text(b()),m.attr({"class":"tv-dialog-layout-button tv-dialog-layout-s"}))}var d=f.find(".tv-dialog-layoutpicker"),g=a.Z5.layout.spawn(),
|
|
h=a.Z5.activeChartWidget.spawn(),k=a.Z5.maximizeCurrentChart.spawn(),l=Q45.symbol.spawn();n=[g,h,k,l];var m=$('<span class="tv-dialog-layout-button">'),q=$('<input type="checkbox" name="publish_entire_layout">').hide().appendTo(m);$('<i class="icon"></i>').appendTo(m);var t=$("<span></span>").appendTo(m);$('<span class="arrow-icon"></span>').appendTo(m);g.subscribe(c);h.subscribe(c);k.subscribe(c);l.subscribe(c);c();TradingView.bindPopupMenu(m,
|
|
function(){var a=q.is(":checked");return[{addClass:"tv-dialog-layout-popup tv-dialog-layout-s",title:"Publish Only "+b(),action:function(){q.attr("checked",!1);c()},active:!a,icon:!0},{addClass:"tv-dialog-layout-popup tv-dialog-layout-"+g.value(),title:"Publish All Charts",action:function(){q.attr("checked",!0);c()},active:a,icon:!0}]},{direction:"up"});m.appendTo(d);e.on("destroy",function(){for(var a=0;a<n.length;a++)n[a].destroy()})}();e.find(".tv-dialog-cancel-button").on("click",function(a){a.preventDefault();
|
|
Q83.showConfirm("Cancel publication","Are you sure you want to abandon your post?",function(){Q83.destroy("Publish Idea")})});if(a.onDestroy)e.on("destroy",a.onDestroy);var t=e.width(),u=e.height();e.resizable({handles:"se",minHeight:u,minWidth:t,stop:function(){TVSettings.setJSON("publishchart.size",{w:e.width(),h:e.height()})}});Q83.applyHandlers(e,{doNotCloseOnBgClickIfShadowbox:!0,doNotCloseOnEsc:!0,doNotCloseOnBgClick:!0});h.on("click",function(a){a.preventDefault();d()});c();
|
|
return{dialog:e,show:c,hide:d,close:function(){Q83.destroy("Publish Idea")}}},showGoProDialog:function(a){a||(a={});Q83.createModalDialog("",{noHeader:!0,addClass:"gopro-dialog ",appearance:"flat"});var b=Q83.modalDialog;b.css({zIndex:1E3});b=b.find(".tv-dialog-content");b.html(Mustache.render(TradingView.templates.dialogs.goPro.layout,{trialButton:Q10&&Q10.trialAvailable&&Q10.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}):TradingView.templates.dialogs.goPro.defaultCopy;c.html(a);b.find(".yes-button").on("click",function(a){this.href===location.href&&a.preventDefault();Q83.destroy()});b.find(".no-button").on("click",function(a){a.preventDefault();Q83.destroy()});Q83.positionDialog();Q83.applyHandlers(null)},
|
|
showAddSymbolDialog:function(a,b){b=$.extend({},{title:"Add Symbol",callback:function(a,b){},overlayOption:!1,overlayOptionChecked:TVSettings.getBool("showAddSymbolDialog.checkboxState",!0),okButtonTitle:"Add Symbol"},b||{});var c=Q83.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);Q83.applyHandlers(c);var d=$('<div class="symbol-edit-widget"></div>'),e=$('<input type="text" class="symbol-edit single" placeholder="Symbol" maxlength="30" style="text-transform: none; font-weight: normal;" autocomplete="off">').appendTo(d),
|
|
f=Q69.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");Q83.destroy(c.data("title"))}}});c.find("div.symbol-edit-place").replaceWith(d);c.find(".tv-dialog").draggable(Q83._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();Q83.positionDialog(c);e.focus()},showConfirmInputsDialog:function(a,b,c){function d(a){var b=c.callback;a=a.state();b(a);Q83.destroy(e.data("title"))}c=$.extend({},{title:"Confirm Inputs",callback:function(a){},okButtonTitle:"Apply"},c||{});var e=Q83.createDialog(c.title,{content:"<div class='main'></div>"});e.css("min-width",0);Q83.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 W41(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();Q83.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 Q83.showCustomDialog({title:a.title,html:b,action:function(b){var d=b.find(".tv-button.ok");d.addClass("process");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):Q83.showError(d||"Unexpected error: can't change profile data",
|
|
b)},onComplete:function(){d.removeClass("process")}});return{notClose:!0}},onCancel:a.cancel})},showProRTTrialOffer:function(a){Q83.createModalDialog("",{noHeader:!0,addClass:"prorttrial-dialog ",appearance:"flat"});var b=Q83.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()});Q83.positionDialog();Q83.applyHandlers(null,{doNotCloseOnBgClickIfShadowbox:!0,doNotCloseOnEsc:!0})},
|
|
showTrialMessage:function(a){Q83.createModalDialog("",{noHeader:!0,addClass:"prorttrial-dialog ",appearance:"flat"});var b=Q83.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(),Q83.destroy())});Q83.positionDialog();Q83.applyHandlers(null)},showTrialMessageSuccess:function(){Q83.showTrialMessage({title:"PRO Plus Trial",copy:"<p>Your 30-day free PRO Plus account has been activated. You are now part of a community of 2 million+ ideas that have been created within TradingView charts. To help get the ball rolling, 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='/e/' class='big-button ok'>LAUNCH CHART</a>",replaseCloseBtnFunc:function(){}})},showTrialConfirmationDialog:function(a){a=a||{};Q83.createModalDialog("",{noHeader:!0,addClass:"trialconfirm-dialog ",appearance:"flat"});var b=Q83.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||"No, thank you")+'</a><a class="yes-button">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);Q83.destroy()});c.on("click",function(b){if("function"==typeof a.onSubmit)return a.onSubmit(b);b.preventDefault()});Q83.positionDialog();Q83.applyHandlers(null)},showEarlyAccessDialog:function(a){Q83.createModalDialog("",{noHeader:!0,addClass:"prorttrial-dialog ",
|
|
appearance:"flat"});var b=Q83.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()});Q83.positionDialog();Q83.applyHandlers(null,{doNotCloseOnBgClickIfShadowbox:!0,doNotCloseOnEsc:!0})},showUnsubscribeConfirmationDialog:function(a,b,c){Q83.createModalDialog(a);Q83.modalDialog.find(".tv-dialog").css("width","450px");Q83.modalDialog.find(".tv-dialog-content").html('<div class="main"><div class="caption-big">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/>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="Cancel '+
|
|
b+' and send feedback" style="margin-right: 10px;"/><input class="tv-button wide no" type="button" value="Do Not Cancel"/></div>');var d=Q83.modalDialog.find(".yes");d.click(function(){var a=Q83.modalDialog.find("textarea").val();a?(d.addClass("process"),c(a)):Q83.showError("Please enter your feedback")});Q83.modalDialog.find(".no").click(function(){Q83.destroy()});Q83.positionDialog();Q83.applyHandlers()},showChangeUserStatusDialog:function(){var a=Q83.createDialog("Update status");
|
|
a.find(".tv-dialog").css("width","400px");a.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="OK" style="margin-right: 10px;"/><input class="tv-button wide cancel" type="button" value="Cancel"/></div></form>');var b=a.find(".ok"),c=a.find('[name="status"]');
|
|
a.find("form").submit(function(){b.addClass("process");changeUserProfileField({name:"status",value:String(c.val()).replace(/^\s+|\s+$/g,""),onSuccess:function(a){var b=$("#change-profile-status"),c=a?a:"Add status...";b.hasClass("tv-editable-active")?b.find('input[type="text"], textarea').val(c):b.text(c);$('[name="status"]').val(a);Q83.destroy("Update status")},onError:function(a){Q83.showError("We'are sorry, something went wrong. Try to reload page.");console.warn(a)},onComplete:function(){b.removeClass("process")}});
|
|
return!1});a.find(".cancel").click(function(){Q83.destroy("Update status")});Modernizr.touch&&c.val("");Q83.positionDialog(a,{considerScroll:!0});Q83.applyHandlers(a);c.focus().select()},showScriptSearchDialog:function(a){function b(){value=e.val();if(value!==h){h=value;f.toggle(!!value);k&&(k.abort&&k.abort(),k=null);g.html('<div class="loading"></div>');var a=Q56.suggest(h);k=a;Q56.list().done(function(b){a.done(function(d){a===k&&
|
|
c(d,b)})})}}function c(a,b){g.empty();a&&(a.length||$('<p class="nothing">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=Q83.createDialog("Search for scripts published by community",{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=void 0,k=null;e.on("input keyup change",
|
|
b);b();Q83.positionDialog(a);Q83.applyHandlers(a);return a},showPrioritySupportDialog:function(){Q83.showCustomDialog({title:"Priority Support",html:TradingView.templates.dialogs.proiritySupport,noButtons:!0})},showNotice:function(a,b,c,d,e){c=c||"";d=d||!1;Q83.createModalDialog(a);Q83.modalDialog.find(".tv-dialog").css("width","400px");Q83.modalDialog.find(".tv-dialog-content").html('<div class="main"><div class="caption-big-center '+c+'">'+b+"</div></div>");Q83.positionDialog();
|
|
Q83.applyHandlers(!1,{doNotCloseOnBgClickIfShadowbox:d,beforeDestroy:e});return Q83.modalDialog},showConfirm:function(a,b,c,d,e){e=e||{};e.dontAskSetting&&TVSettings.getBool(e.dontAskSetting)?c():(Q83.createModalDialog(a,e),Q83.modalDialog.find(".tv-dialog").css("width","400px"),Q83.modalDialog.find(".tv-dialog-content").html('<div class="main"><div class="caption-big">'+b+"</div>"+(e.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>':
|
|
"")+'</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>'),e.okButtonText&&Q83.modalDialog.find(".ok").val(e.okButtonText),e.cancelButtonText&&Q83.modalDialog.find(".cancel").val(e.cancelButtonText),Q83.modalDialog.find(".ok").click(function(){e.dontAskSetting&&$("#confirm-dialog-checkbox").is(":checked")&&
|
|
TVSettings.setValue(e.dontAskSetting,!0);c();Q83.destroy()}),Q83.modalDialog.find(".cancel").click(function(){d&&d();Q83.destroy()}),Q83.positionDialog(),Q83.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");Q83.showError(b,Q83.modalDialog);return}}Q83.destroy();c&&c(a)}var g=e&&e.defaultValue,h=e&&e.validate;Q83.createModalDialog(a,e);Q83.modalDialog.find(".tv-dialog").css("width",
|
|
"400px");Q83.modalDialog.find(".tv-dialog-content").html('<div class="main"><form><div class="caption-big-center slim">'+b+': <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="OK" style="margin-right: 10px;"/><input class="tv-button wide cancel" type="button" value="Cancel"/></div>');var k=Q83.modalDialog.find('[name="prompt-value"]');g&&k.val(g);Q83.modalDialog.find("form").submit(function(a){f();
|
|
a.preventDefault()});Q83.modalDialog.find(".ok").click(function(a){f();a.preventDefault()});Q83.modalDialog.find(".cancel").click(function(){Q83.destroy();d&&d(value)});Q83.positionDialog();Q83.applyHandlers();setTimeout(function(){k.focus().select()},0)},showCustomDialog:function(a){function b(b){var c=a.action(Q83.modalDialog),f=c&&c.notClose;(!c||c.error)&&void 0!==c||f?c.error&&Q83.showError(c.error):Q83.destroy();b.preventDefault()}function c(b){if("function"===
|
|
typeof a.onCancel)a.onCancel();else Q83.destroy()}Q83.createModalDialog(a.title||"Dialog");Q83.modalDialog.find(".tv-dialog").css("width",a.width||"400px");Q83.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="OK" style="margin-right: 10px;"/>')+(a.noButtonCnacel?"":'<input class="tv-button wide cancel" type="button" value="Cancel"/>')+
|
|
"</div>"));a.okButtonText&&Q83.modalDialog.find(".ok").val(a.okButtonText);a.cancelButtonText&&Q83.modalDialog.find(".cancel").val(a.cancelButtonText);Q83.modalDialog.find(".ok").click(b);Q83.modalDialog.find("form").submit(b);Q83.modalDialog.find(".cancel").click(c);Q83.modalDialog.find(".tv-dialog-title-close").click(c);Q83.positionDialog();Q83.applyHandlers();return Q83.modalDialog},createModalDialog:function(a,b){b=b||{};null!==Q83.modalDialog&&
|
|
Q83.destroy();Q83.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&&Q83.modalDialog.addClass("transparent");
|
|
b.width&&Q83.modalDialog.find(".tv-dialog").css({width:b.width});b.content&&Q83.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&&Q83.modalDialog.css("z-index",b.zIndex)},createDialog:function(a,b){if(Q83.isOpen(a)){var c=Q83.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=Q83.dialogs&&Q83.dialogs.length?MathEx.max($.map(Q83.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",Q83.dialogs.length+1);Q83.dialogs.push({title:a,dialog:c,id:Q83.dialogs.length+
|
|
1});d={start:function(a,b){for(var c=b.helper.css("z-index"),d=0,k=null,l=0;l<Q83.dialogs.length;l++){var m=Q83.dialogs[l].dialog.css("z-index");m>d&&(d=m,k=Q83.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(Q83._constrainDraggableOptionsIfNeeded(d));return c},positionDialog:function(a,b,c){c=c||{};b=b||c.position;if(a){var d=a.width(),e=a.height(),f=$(window).width(),
|
|
g=$(window).height();b&&b.top&&b.left?(d=c.forcePosition?b.left:Math.max(2,Math.min(f-d-4,b.left))+"px",e=c.forcePosition?b.top:Math.max(2,Math.min(g-e-4,b.top))+"px"):b&&b.considerScroll?(b=$(document),d=Math.round((f-d)/2+b.scrollLeft())+"px",e=Math.round((g-e)/2+b.scrollTop())+"px"):(d=Math.round((f-d)/2)+"px",e=Math.round((g-e)/2)+"px");c.smooth?a.animate({left:d,top:e}):a.css({left:d,top:e})}else a=Q83.modalDialog,a=a.find(".tv-dialog"),a.css("margin-left",-Math.round(a.outerWidth()/2)+
|
|
"px"),a.css("margin-top",-Math.round(a.outerHeight()/2)+"px")},applyHandlers:function(a,b){var c=!a||a===this.modalDialog;b=b||{};var d=c?function(){Q83.destroy()}:function(){Q83.destroy(a.data("title"))};a||(a=Q83.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")||(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:Q83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-error").hide()});clearInterval(Q83.messageInterval)});$(".tv-dialog .tv-dialog-message").mouseenter(function(){$(this).animate({marginTop:Q83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-message").hide()});clearInterval(Q83.messageInterval)});
|
|
b.doNotCloseOnEsc||$(window).bind("keyup.hideDialog",function(b){if("27"==b.keyCode)return a?Q83.destroy(a.data("title")):Q83.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:Q83.NOTIFICATION_ANIMATION_START_OFFSET,left:"10px",right:"10px",opacity:"0"}).show().animate({marginTop:0,opacity:1},"fast");clearInterval(Q83.messageInterval);Q83.messageInterval=
|
|
setInterval(function(){$(".tv-dialog .tv-dialog-error").animate({marginTop:Q83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-error").hide()});clearInterval(Q83.messageInterval)},Q83.messageDelay)},showMessage:function(a){$(".tv-dialog .tv-dialog-message").text(a).css({marginTop:Q83.NOTIFICATION_ANIMATION_START_OFFSET,left:"10px",right:"10px",opacity:"0"}).show().animate({marginTop:0,opacity:1},"fast");clearInterval(Q83.messageInterval);
|
|
Q83.messageInterval=setTimeout(function(){$(".tv-dialog .tv-dialog-message").animate({marginTop:Q83.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){$(".tv-dialog .tv-dialog-message").hide()});clearInterval(Q83.messageInterval)},Q83.messageDelay)},showStocktwitsDialog:function(a,b){return Q83.showCustomDialog({title:"Send Message to stocktwits",html:Mustache.render('<textarea style="width: 100%" maxLength="120">{{text}}</textarea>',{text:a}),action:b})},
|
|
isOpen:function(a){for(var b=0;b<Q83.dialogs.length;b++)if(Q83.dialogs[b].title==a)return!0;return!1},get:function(a){for(var b=0;b<Q83.dialogs.length;b++)if(Q83.dialogs[b].title==a)return Q83.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){void 0!==Q83.chart&&(Q83.chart.destroy(),delete Q83.chart);$(window).unbind("keyup.hideDialog");
|
|
if(a)for(var b=0;b<Q83.dialogs.length;b++)Q83.dialogs[b].title==a&&(Q83.dialogs[b].dialog.trigger("destroy"),$(document).unbind("mouseup.hideDialog"+Q83.dialogs[b].id),$("input",Q83.dialogs[b].dialog).blur(),Q83.dialogs[b].dialog.remove(),Q83.dialogs.splice(b,1));else Q83.modalDialog&&(Q83.modalDialog.find(".tv-dialog").trigger("destroy"),Q83.modalDialog.remove(),Q83.modalDialog=null)},changeTitle:function(a,b){if(a)for(var c=0;c<Q83.dialogs.length;c++)if(Q83.dialogs[c].title==
|
|
a){var c=Q83.dialogs[c],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(){Q83.destroy(b)});break}},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.Z4=a}ChartSaver.prototype.saveToJSON=function(){return this._fillSavingInfo(!1,!0)};ChartSaver.prototype._fillAsyncInfo=function(a,b,c){var d=JSON.parse(a.content),e=this.Z4;b||(c=!0);var f=$.Deferred();c?e.asyncState(!!b).then(function(b){a.content=JSON.stringify($.extend(!0,d,b));f.resolve(a)}):Z2.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.Z4,e=d.activeChartWidget.value(),f=d.metaInfo,g=e.model().mainSeries(),h=g.properties(),k=g.symbolInfo();if(!(g&&g.symbolInfo()&&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){Q83.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=Q83.showPublishChartDialog($.extend({Z5:this.Z4,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;"ok:"===a.substr(0,3)?(a=a.substr(3),a=JSON.parse(a),d.Z4.metaInfo.id.value()||d.Z4.metaInfo.id.setValue(a.id),b.closeForm&&b.closeForm(),d._lastPublishUrl=a.publishUrl,d.hWnd&&(d.hWnd.location=a.publishUrl)):(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&&""!==a.name&&""!==a.description&&4E3>=a.description.length&&64>=a.name.length&&($.cookie("publish_request_id",e.publish_request_id,{path:"/"}),d.hWnd=window.open("/loading/","_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&&(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.Z4.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.")});saveChart(b,e,a,c)};
|
|
function takeSnapshot(a,b,c,d){d=d||{};var e={wl:d.wl,images:JSON.stringify(a.images()),previews:d.previews};if(d.cme||a.activeChartWidget.value().onCmeWidget())e.cme=!0;a=D76.enabled("charting_library")?d.snapshotUrl||"https://www.tradingview.com/snapshot/":"/snapshot/";$.post(a,e,function(a){a?b(a):c()}).fail(function(){c()})};Q71=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()};Q71.prototype._DEFAULT_OPTIONS={saveTab:!1};Q71.prototype.initActivePage=function(){var a=0;this.options.saveTab&&(a=TVSettings.getInt(this.options.saveTab,0));this.setActivePage(a)};
|
|
Q71.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)};Q71.prototype.initHandlers=function(){this._$tabs.on("click","*",this._onTabClick.bind(this))};Q71.prototype._onTabClick=function(a){a=$(a.currentTarget).index();this.setActivePage(a)};
|
|
Q71.prototype.addPage=function(a,b){var c=this.count();this._$tabs.append(a);this._$pages.append(b);c||this.setActivePage(0);return c};Q71.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)};Q71.prototype.count=function(){return this._$tabs.children().length};
|
|
Q71.prototype.index=function(){return this._$tabs.children().filter(".active:eq(0)").index()};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),D76.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].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&&"function"===typeof b[e.name]&&b[e.name].call(e,e.data,function(){}))});return function(g,h){a[h]={};d=c[h]=g;return{on:function(a,c){b[a]=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,data:c,provider:"TradingView"};
|
|
a&&"function"===typeof a.postMessage&&a.postMessage(JSON.stringify(b),"*")}}}}();Q45=function(){function a(a,k){function q(n){function u(b){if(D76.enabled("same_data_requery")||C.value()!==b)k?k.setSymbol(b):a.setSymbol(b)}function z(){b.setValue(C.value())}function s(){c.setValue(v.shortName.value());var a=w.symbolInfo();a?(e.setValue(!!a.has_intraday),a.hasOwnProperty("supported_resolutions")?f.setValue(a.supported_resolutions):f.setValue(void 0)):e.deleteValue()}function A(b){if(D76.enabled("same_data_requery")||G.value()!==b)k?k.setResolution(b):
|
|
a.setResolution(b)}function B(){d.setValue(G.value())}a.modelCreated().unsubscribe(null,q);var w=a.model().mainSeries(),v=w.properties(),C=v.symbol;C.subscribe(null,z);b.setValue(C.value());b.subscribe(u);w.onSymbolResolved().subscribe(null,s);w.onSymbolError().subscribe(null,s);s();var G=v.interval;G.subscribe(null,B);d.setValue(G.value());d.subscribe(A);a.readOnly()&&(b.writeLock=!0);g=function(){C.unsubscribe(null,z);b.unsubscribe(u);w.onSymbolResolved().unsubscribe(null,s);w.onSymbolError().unsubscribe(null,
|
|
s);G.unsubscribe(null,B);d.unsubscribe(A);delete b.writeLock;g=new Function;h=new Function}}g();h=function(){return a};var n=a.model();n?q(n):(a.modelCreated().subscribe(null,q),g=function(){a.modelCreated().unsubscribe(null,q);g=new Function;h=new Function})}var b=new WatchedValue,c=new WatchedValue,d=new WatchedValue,e=new WatchedValue,f=new WatchedValue,g=new Function,h=new Function,k=new Function;return{symbol:b,seriesShortSymbol:c.readonly(),interval:d,intraday:e.readonly(),supportedResolutions:f.readonly(),
|
|
bindToChartWidget:a,unbindFromChartWidget:function(){g()},getChartWidget:function(){return h()},bindToSearchCharts:function(a){function c(a){e=!0;b.setValue(a.resolved_symbol);e=!1}function d(b){e||a.search(b)}k();var e=!1;a.onSearchBySymbol.subscribe(null,c);b.subscribe(d);k=function(){a.onSearchBySymbol.unsubscribe(null,c);b.unsubscribe(d);k=new Function}},unbindFromSearchCharts:function(){k()},bindToChartWidgetCollection:function(b){g();b.activeChartWidget.subscribe(function(c){g();a(c,b)},{callWithLast:!0})}}}();
|
|
function linkingSetSymbol(a){a&&"string"===typeof a&&($(".header-chart-panel .symbol-edit-wrap input").val(Q68.shortName(a)),Q45.symbol.setValue(a))};Q15={force_prefix:"forcefeaturetoggle.",enableFeature:function(a){localStorage[this.force_prefix+a]="true"},disableFeature:function(a){localStorage.removeItem(this.force_prefix+a)}};
|
|
TradingView.Z17=function(a){if(TradingView.pushStreamMultiplexer)TradingView.pushStreamMultiplexer.on("featuretoggle",function(b){a[b.name]=b.state;localStorage["featuretoggle."+b.name]=Math.random()<=a[b.name]});return function(b){if("true"===localStorage[Q15.force_prefix+b]||window.is_authenticated&&"undefined"!=typeof user&&user&&user.settings[Q15.force_prefix+b])return!0;if(!a[b])return!1;if(1===a[b])return!0;var c=localStorage["featuretoggle."+
|
|
b];return void 0===c||null===c?localStorage["featuretoggle."+b]=Math.random()<=a[b]:"true"===c}}(window.featureToggleState||{});(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"));if(/hidpi/.test(location.hash)||2==b&&/Macintosh/.test(navigator.userAgent)&&!(2880<a.innerWidth*b))a.hidpiCanvasRatio=b,function(a){(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",drawImage:[1,2,3,4]},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.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.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(){Q72={};Q72.sendReport=function(a,b){var c=window.Z2||window._exposed_chartWidgetCollection&&_exposed_chartWidgetCollection.activeChartWidget.value();if(c&&(!c.onWidget()||TradingView.isCmeWidget)){b=b||{};var d={event:a||"error",user:window.user&&window.user.username||"Guest",websocketAddress:Z15._socket?Z15._socket.host+":"+Z15._socket.options.port:"",log:JSON.stringify(Q46),ws_reason:b.reason||
|
|
"",ws_code:b.code||"",js_errors:__tv_js_errors.slice(0,10)},e="";switch(Q13()){case "battle":e="https://telemetry.tradingview.com";break;case "local":e="http://localhost:7373"}e&&setTimeout(function(){$.post(e+"/report",d)},2E3)}}})();Q82.ChartapiMessager=function(a,b){this._server=a;this._session=b;this._timezone=null};Q82.ChartapiMessager.prototype.setTimezone=function(a){this._timezone="exchange"==a?"exchange":PineJsCalendar.get_timezone(a)};Q82.ChartapiMessager.prototype.onRequestMetadata=function(a,b){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,a,b]})};
|
|
Q82.ChartapiMessager.prototype.onSymbolResolved=function(a,b){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,a,b]})};Q82.ChartapiMessager.prototype.onSymbolError=function(a,b){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,a,b]})};Q82.ChartapiMessager.prototype.onStudyError=function(a,b){this._server.receiveLocalResponse({method:"study_error",params:[this._session,a,b]})};
|
|
Q82.ChartapiMessager.prototype.onSeriesLoading=function(a,b){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,a,b]})};Q82.ChartapiMessager.prototype.onSeriesCompleted=function(a,b,c){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,a,c,b]})};Q82.ChartapiMessager.prototype.onSeriesError=function(a,b){this._server.receiveLocalResponse({method:"series_error",params:[this._session,a,b]})};
|
|
Q82.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:[]}]})};Q82.ChartapiMessager.prototype.onStudyCompleted=function(a,b){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,a,b]})};
|
|
Q82.ChartapiMessager.prototype.onStudyLoading=function(a,b){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,a,b]})};
|
|
Q82.ChartapiMessager.prototype.onTickmarksUpdated=function(a,b,c){b=b.slice(0);var d=PineJsCalendar.get_timezone(c.timezone);for(c=0;c<b.length;++c)b[c]=this.timeInTimezone(b[c],d);var d=[],e=[],f;for(c=0;c<b.length;++c){var g=b[c];d.push([this._spanByTime(g,f),g,a+c]);e.push(g);f=g}this._server.receiveLocalResponse({method:"tickmark_update",params:[this._session,{index:a,zoffset:0,changes:e,marks:d}]})};
|
|
Q82.ChartapiMessager.prototype.onTimescaleUpdate=function(a,b,c,d,e){c=c.slice(0);var f=PineJsCalendar.get_timezone(d.timezone);for(d=0;d<c.length;++d)c[d].value[0]=this.timeInTimezone(c[d].value[0],f);f={};f[a]={series:c,turnaround:b};a=[];b=[];var g;for(d=0;d<c.length;++d){var h=c[d].value[0];a.push([this._spanByTime(h,g),h,e+d]);b.push(h);g=h}this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,f,{index:e,zoffset:0,changes:b,marks:a}]})};
|
|
Q82.ChartapiMessager.prototype.onSeriesTimeframeUpdate=function(a,b,c,d){this._server.receiveLocalResponse({method:"series_timeframe",params:[this._session,a,b,c,d]})};Q82.ChartapiMessager.prototype.onPointsetDataUpdate=function(a,b,c,d){this._onDataUpdate(a,b,c,void 0,d,1)};Q82.ChartapiMessager.prototype.onDataUpdate=function(a,b,c,d,e){this._onDataUpdate(a,b,c,d,e,0)};
|
|
Q82.ChartapiMessager.prototype._onDataUpdate=function(a,b,c,d,e,f){c=c.slice(0);e=PineJsCalendar.get_timezone(e.timezone);for(var g=0;g<c.length;++g)c[g].value[f]=this.timeInTimezone(c[g].value[f],e);f={};d=d?JSON.stringify({offsets:d}):"";f[a]={s:c,ns:{d:d,indexes:[]},turnaround:b};this._server.receiveLocalResponse({method:"data_update",params:[this._session,f]})};Q82.ChartapiMessager.prototype.onQuotesData=function(a){this._server.receiveLocalResponse({method:"quote_symbol_data",params:a})};
|
|
Q82.ChartapiMessager.prototype.timeInTimezone=function(a,b){return"exchange"==this._timezone?parseInt(PineJsCalendar.utc_to_cal(b,1E3*a).valueOf()/1E3):parseInt(PineJsCalendar.utc_to_cal(this._timezone,1E3*a).valueOf()/1E3)};Q82.ChartapiMessager.prototype.timeInGMT=function(a,b){return"exchange"==this._timezone?parseInt(PineJsCalendar.cal_to_utc(b,new Date(1E3*a))/1E3):parseInt(PineJsCalendar.cal_to_utc(this._timezone,new Date(1E3*a))/1E3)};
|
|
Q82.ChartapiMessager.prototype._spanByTime=function(a,b){var c=[{divisor:1,span:20},{divisor:300,span:21},{divisor:1800,span:22},{divisor:3600,span:30},{divisor:10800,span:31},{divisor:21600,span:32},{divisor:43200,span:33},{divisor:86400,span:40},{divisor:604800,span:50}];if(b){var d=new Date(1E3*b),e=new Date(1E3*a);if(e.getYear()!=d.getYear())return 70;if(e.getMonth()!=d.getMonth())return 60;if(e.getDate()!=d.getDate())return 50}for(d=c.length-1;0<=d;--d)if(0===a%c[d].divisor)return c[d].span;
|
|
throw"This should never happen";};ChartapiMessagerInstances=[];if(!D76.enabled("charting_library"))throw"ChartsStorage is intended to be used in Charting Library only";
|
|
ChartsStorage=function(){var a={},b,c,d;a.initialize=function(a,f,g){b=a;c=f;d=g};a.getCharts=function(a){return $.ajax({url:"{0}/{1}/charts?client={2}&user={3}".format(d,"1.0",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,f){$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(d,
|
|
"1.0",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);f()})};a.saveChart=function(a,f,g,h,k,l,m){var q="{0}/{1}/charts?client={2}&user={3}".format(d,"1.0",b,c);"undefined"!=typeof k&&(q+="&chart="+k);$.ajax({url:q,data:{name:a,content:JSON.stringify(h),symbol:f,resolution:g},type:"POST",crossDomain:!0}).done(function(a){a=JSON.parse(a);"ok"!=a.status?(console.warn("Chart save request failed: "+a.message),
|
|
m()):l(a.id)}).fail(function(){m()})};a.loadChart=function(a){$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(d,"1.0",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,Z16.emit("chart_load_requested",b))}).fail(function(){console.warn("Error loading chart")})};return a}();Q82.ChartApi=function(a){this._notificationHandlers=[];this._sessions=[];this.studyCounter=0;this._enabled=this._connected=!1;this._studyEngine=new Q79(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]})});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:"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)}))};Q82.ChartApi.prototype.purgeCache=function(a){this._symbolIdCache={};delete this._recentSeriesId;this._studyEngine.purgeCache();this._studyEngine.purgeRangeExtensionData()};
|
|
Q82.ChartApi.prototype.setAdditionalBarsRequestEnabled=function(a){this._enabledMoreBarsRequest=a};Q82.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})}};
|
|
Q82.ChartApi.prototype._setupAutoSave=function(){var a=this,b=!1;Q77.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))})};Q82.ChartApi.prototype.defaultWatchlistSymbols=function(){return this._watchlistSettings.default_symbols};
|
|
Q82.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}):[]};Q82.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}};Q82.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()};
|
|
Q82.ChartApi.prototype.supportedExchangesList=function(){return this._studyEngine.supportedExchangesList()};Q82.ChartApi.prototype.start=function(){this._enabled=!0;this._fireEvent("start_enabled")};Q82.ChartApi.prototype._logMessage=function(a){this._enableLogging&&console.log(a)};Q82.ChartApi.prototype.unsubscribe=function(a,b){var c=this._callbacks[a];c&&c.splice(c.indexOf(b),1)};
|
|
Q82.ChartApi.prototype.on=function(a,b){this._callbacks.hasOwnProperty(a)||(this._callbacks[a]=[]);this._callbacks[a].push(b);return this};Q82.ChartApi.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]=[])}};Q82.ChartApi.prototype.setAuthToken=function(a,b){throw"This method is not implemented";};Q82.ChartApi.prototype.authTokenRequired=function(a){return!1};
|
|
Q82.ChartApi.prototype.chartCreateSession=function(a,b){};Q82.ChartApi.prototype.chartDeleteSession=function(a){};Q82.ChartApi.prototype.createSession=function(a,b){ChartapiMessagerInstances[a]=new Q82.ChartapiMessager(this,a);this._sessions[a]=b;this._notificationHandlers[a]=b;if(this.connected())b.onMessage({method:"connected",params:[]})};Q82.ChartApi.prototype.removeSession=function(a){delete this._sessions[a];delete this._notificationHandlers[a];this.chartDeleteSession(a)};
|
|
Q82.ChartApi.prototype.connected=function(){return this._connected};Q82.ChartApi.prototype._getHost=function(a){return a};Q82.ChartApi.prototype._isSafari5=function(){return!!navigator.appVersion.match(/\/5\.[^\/]*?Safari\//)};Q82.ChartApi.prototype._isIE9=function(){return!!navigator.appVersion.match(/MSIE 9/)};Q82.ChartApi.prototype._isIOS5=function(){return!!navigator.appVersion.match(/iPad, CPU 5/)};
|
|
Q82.ChartApi.prototype._getPort=function(a){return this._isSafari5()||this._isIE9()?8081:a};Q82.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()})}};Q82.ChartApi.prototype.disconnect=function(){throw"This method is not implemented";};
|
|
Q82.ChartApi.prototype.switchTimezone=function(a,b){ChartapiMessagerInstances[a].setTimezone(b);if(this._recentSeriesId){var c=this;this._doWhenSeriesSymbolIdIsReady(this._recentSeriesId,function(b){c._studyEngine.recreateSources(b.name,c._seriesIdCache[c._recentSeriesId].resolution,a);c._doWhenSeriesDataReceived(function(){var e=c._seriesIdCache[c._recentSeriesId].resolution,f=Z2.model().mainSeries().data().last();c._studyEngine.rebuildExtrapolatedData(a,b.name,e,b.info,1E3*f.value[0])})})}};
|
|
Q82.ChartApi.prototype.receiveLocalResponse=function(a){this._logMessage("< "+a.method);this._dispathNotification(a);this._fireEvent("message_"+a.method,void 0,!0)};Q82.ChartApi.prototype.getMarks=function(a,b,c,d,e){this._studyEngine.getMarks(a,b,c,d,e)};
|
|
Q82.ChartApi.prototype.resolveSymbol=function(a,b,c,d,e){function f(b,d){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 HandlerInfo(d,b);delete this._symbolIdCache[b];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},!0),ChartapiMessagerInstances[a].onSymbolResolved(b,d))},function(a){f(b,a)})};Q82.ChartApi.prototype._doWhenSymbolIdIsReady=function(a,b){function c(){e&&(b({name:d._symbolIdCache[a].name,info:d._symbolIdCache[a].info}),e=!1)}var d=this,e=!0;this._symbolIdCache.hasOwnProperty(a)?c():(this.on(a+"_resolved",function(a){c()}),this.on(a+"_resolve_fail",function(){c()}))};
|
|
Q82.ChartApi.prototype._doWhenSeriesDataReceived=function(a){function b(){Z2.model().mainSeries().onDataLoaded().unsubscribe(null,b);a()}Z2.model().mainSeries().onDataLoaded().subscribe(null,b)};
|
|
Q82.ChartApi.prototype._doWhenSeriesSymbolIdIsReady=function(a,b){function c(){if(f){var c=e._symbolIdCache[e._seriesIdCache[a].symbolId];b({name:c.name,info:c.info});f=!1}}function d(b){b.symbolId==e._seriesIdCache[a].symbolId&&(e.unsubscribe("symbol_resolved",d),c())}var e=this,f=!0;this._symbolIdCache.hasOwnProperty(this._seriesIdCache[a].symbolId)?c():(this.on("symbol_resolved",d),this.on("resolve_fail",function(b){b==e._seriesIdCache[a].symbolId&&c()}))};
|
|
Q82.ChartApi.prototype.createSeries=function(a,b,c,d,e,f,g){c=c||"";this._notificationHandlers[a][b]=new HandlerInfo(g,b);this._recentSeriesId=b;var h=this;this._seriesIdCache[b]={symbolId:d,resolution:e};this._studyEngine.updateSeriesTurnaround(b,c);this._doWhenSeriesSymbolIdIsReady(b,function(d){h._studyEngine.createSeries(d.name,e,a,b,c)})};Q82.ChartApi.prototype.removeSeries=function(a,b,c){this._notificationHandlers[a][b]=new HandlerInfo(c,b);this._studyEngine.removeSeries(b)};
|
|
Q82.ChartApi.prototype._exactBarsCountOfTimeFrame=function(a,b){var c=Z2.model().mainSeries().bars();c._valueAt(c.size()-1);for(var d=PineJsBarBuilder.alignDWMPeriodsBack(b.timezone,b.session,a.resolution,a.interval,(new Date).valueOf()),e=c.size(),d=d/1E3,f=0,g=0;g<e;++g)if(c._valueAt(g)[0]>d){f=g;break}return e-f};
|
|
Q82.ChartApi.prototype.modifySeries=function(a,b,c,d,e,f){c=c||"";var g=this._seriesIdCache[b]?this._seriesIdCache[b].resolution:void 0,h=this;this._notificationHandlers[a][b]=new HandlerInfo(function(k){if("series_completed"==k.method){var l=PineJS.Symbol.parsePeriod(g),m=PineJS.Symbol.parsePeriod(e);m.range&&l.range!=m.range&&(l=Z2.model().mainSeries().bars().size(),m=h._exactBarsCountOfTimeFrame(m.range,h._symbolIdCache[d].info),m=Math.max(0,l-1-m),l=Math.max(m,l-1),ChartapiMessagerInstances[a].onSeriesTimeframeUpdate(b,
|
|
c,m,l))}f(k)},b);this._recentSeriesId=b;this._studyEngine.updateSeriesTurnaround(b,c);this._seriesIdCache[b]={symbolId:d,resolution:e};this._doWhenSeriesSymbolIdIsReady(b,function(c){h._studyEngine.purgeGuardData(b);h._studyEngine.purgeRangeExtensionData();h._studyEngine.recreateSources(c.name,e,a,!0)})};Q82.ChartApi.prototype.requestMoreData=function(a,b,c,d){this._enabledMoreBarsRequest&&(this._notificationHandlers[a][b]=new HandlerInfo(d,b),this._studyEngine.extendSeriesRange(b,a,c))};
|
|
Q82.ChartApi.prototype.setStudiesAccessController=function(a){this.studiesAccessController=a};Q82.ChartApi.prototype.setWatchlistSettings=function(a){this._watchlistSettings=a};Q82.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()};
|
|
Q82.ChartApi.prototype.requestMetadata=function(a,b,c){this._notificationHandlers[a][b]=new HandlerInfo(c,b);c=this.studiesAccessController.getEnabledTools();ChartapiMessagerInstances[a].onRequestMetadata(b,c)};Q82.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCounter<STUDY_COUNT_LIMIT};
|
|
Q82.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 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++})};
|
|
Q82.ChartApi.prototype.removeStudy=function(a,b,c){this._notificationHandlers[a][b]=new HandlerInfo(c,b);this._studyEngine.removeStudy(b);this.studyCounter--};Q82.ChartApi.prototype.modifyStudy=function(a,b,c,d,e){c=c||"";this._notificationHandlers[a][b]=new HandlerInfo(e,b);[a,b,c].concat(d);this._studyEngine.recomputeStudy(b,d,a,c)};
|
|
Q82.ChartApi.prototype.createPointset=function(a,b,c,d,e,f,g){this._notificationHandlers[a][b]=new HandlerInfo(g,b);var h=this;this._doWhenSymbolIdIsReady(d,function(c){h._studyEngine.createPointset(a,b,c.info.full_name,c.info,e,f)})};Q82.ChartApi.prototype.modifyPointset=function(a,b,c,d,e){throw"This call is not implemented";};Q82.ChartApi.prototype.removePointset=function(a,b,c){this._notificationHandlers[a][b]=new HandlerInfo(c,b);this._studyEngine.removePointset(b)};
|
|
Q82.ChartApi.prototype.requestMoreTickmarks=function(a,b,c,d){this._notificationHandlers[a][b]=new HandlerInfo(d,b);var e=this;this._doWhenSeriesSymbolIdIsReady(b,function(d){e._studyEngine.onMoreTickmarksRequested(a,d.name,d.info,e._seriesIdCache[b].resolution,c)})};Q82.ChartApi.prototype.requestFirstBarTime=function(a,b,c,d){this._notificationHandlers[a][b]=new HandlerInfo(d,b)};Q82.ChartApi.prototype._invokeHandler=function(a,b){a&&a(b)};
|
|
Q82.ChartApi.prototype._sendRequest=function(a,b){throw"This method is not implemented";};Q82.ChartApi.prototype._onMessage=function(a){throw"This method is not implemented";};Q82.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};
|
|
Q82.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)}};Q82.ChartApi.prototype._invokeNotificationHandler=function(a,b,c){if(void 0!==b){var d=this._notificationHandlers[a][b];void 0!==d&&this._invokeHandler(d.handler,c);"series_deleted"!=c.method&&"study_deleted"!=c.method||delete this._notificationHandlers[a][b]}};
|
|
Q82.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)};Q82.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)}};Q82.ChartApi.prototype.unpack=function(a){throw"This method is not implemented";};
|
|
Q82.ChartApi.prototype.reconnectTimeout=function(a){throw"This method is not implemented";};Q82.ChartApi.prototype.quoteCreateSession=function(a){return this._studyEngine.quoteCreateSession(a)};Q82.ChartApi.prototype.quoteDeleteSession=function(a){return this._studyEngine.quoteDeleteSession(a)};Q82.ChartApi.prototype.quoteSetFields=function(a,b){return this._studyEngine.quoteSetFields(a,b)};
|
|
Q82.ChartApi.prototype.quoteAddSymbols=function(a,b){return this._studyEngine.quoteAddSymbols(a,b)};Q82.ChartApi.prototype.quoteRemoveSymbols=function(a,b){return this._studyEngine.quoteRemoveSymbols(a,b)};Q82.ChartApi.prototype.quoteFastSymbols=function(a,b){return this._studyEngine.quoteFastSymbols(a,b)};Q82.ChartApi.prototype.depthCreateSession=function(a,b,c){};Q82.ChartApi.prototype.depthDeleteSession=function(a){};
|
|
Q82.ChartApi.prototype.depthSetSymbol=function(a,b){};Q82.ChartApi.prototype.depthClearSymbol=function(a){};Q82.ChartApi.prototype.depthSetScale=function(a,b){};Q82.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))};
|
|
Q82.ChartApi.prototype.StudiesAccessController=function(a,b){this._studyEngine=a;this._studiesAccess=b};Q82.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};
|
|
Q82.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)};Q82.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(a){return(a=this._findTool(a))&&a.grayed};
|
|
Q82.ChartApi.prototype.ObsoleteStudiesAccessController=function(a,b,c){this._studyEngine=a;this._enabledStudiesList=b;this._disabledStudiesList=c};
|
|
Q82.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};
|
|
Q82.ChartApi.prototype.ObsoleteStudiesAccessController.prototype.isToolGrayed=function(){return!1};requireFullInterfaceImplementation(Q82.ChartApi,"Q82.ChartApi",D97,"D97");Q82.DatafeedInterface=function(){};Q82.DatafeedInterface.prototype.getConfigurationData=function(){};Q82.DatafeedInterface.prototype.searchSymbolsByName=function(a,b){};Q82.DatafeedInterface.prototype.resolveSymbol=function(a,b,c){};Q82.DatafeedInterface.prototype.getBars=function(a,b,c,d,e,f){};Q82.DatafeedInterface.prototype.getBarsByRange=function(a,b,c,d,e,f){};Q82.DatafeedInterface.prototype.subscribeBars=function(a,b,c){};
|
|
Q82.DatafeedInterface.prototype.unsubscribeBars=function(a){};declareClassAsPureInterface(Q82.DatafeedInterface,"Q82.DatafeedInterface");this.TzData=TzData=function(){var a={"America/New_York":{time:[-2717668562,-1633298400,-1615154400,-1601848800,-1583704800,-1577923200,-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,-883612800,-880236E3,-76941E4,-765410400,-757382400,-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,-94694400,-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,315569527201],offset:[-17762,-18E3,-14400,-18E3,-14400,-18E3,
|
|
-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,-18E3,-14400,-14400,-18E3,-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,-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,-757382400,-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,-94694400,-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,315569527201],offset:[-28378,-28800,-25200,-28800,-25200,-28800,-25200,-25200,-28800,-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,-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,-1577923200,-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,-883612800,-880236E3,-769413600,-765410400,-757382400,-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,-94694400,-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,315569527201],offset:[-21036,-21600,-18E3,-21600,-18E3,-21600,-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,-21600,-18E3,-18E3,-21600,-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,-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/Toronto":{time:[-2366755200,-1632088800,-1615154400,-1609459200,-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,-757382400,-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,126230400,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,315569527201],offset:[-19052,-18E3,-14400,-18E3,-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,-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,-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,536457600,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,
|
|
315569527201],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,-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,938908800,952041600,1198972800,1205625600,1224374400,1237075200,315569527201],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/Bogota":{time:[-2707689600,-1739059200,704851200,733881600,315569527201],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,670384800,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,315569527201],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,347155200,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,315569527201],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,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,-776556E3,-765925200,-761173200,-757382400,-748476E3,-733266E3,-717627600,-714603600,-71037E4,-701902800,-684972E3,-670453200,-654127200,-639003600,315532800,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,315569527201],offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,10800,7200,3600,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,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,-37238400,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,820454400,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,315569527201],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,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,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,283996800,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,315569527201],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,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,220924800,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,315569527201],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,3600,3600,7200,3600,7200,3600,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,-857253600,-844552800,-828219600,-812498400,-796867200,-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,220924800,228877200,244000800,260326800,276055200,291776400,307504800,323830800,338954400,354675600,370404E3,386125200,401853600,417574800,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978E3,559706400,567993600,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,315569527201],offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,3600,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,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,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/Istanbul":{time:[-2840140800,-1869868800,-1693699200,-168048E4,-1570406400,-1552176E3,-1538352E3,-1522540800,-1507507200,-1490572800,-1440201600,-1428019200,-1409702400,-1396483200,-931132800,-922752E3,-917827200,-892425600,-875836800,-857347200,-781056E3,-764726400,-744336E3,-733795200,-716428800,-701913600,-684979200,-670464E3,-654134400,-639014400,-621820800,-60696E4,-590025600,-575424E3,-235612800,-228268800,
|
|
-177724800,-165715200,10540800,23846400,41990400,55296E3,74044800,87350400,107917200,12123E4,133927200,152686800,165369600,183513600,202435200,215568E3,228873600,245808E3,260323200,277257600,291783600,308793600,323838E3,340243200,354682800,371692800,386132400,403142400,428457600,433900800,482803200,496713600,512532E3,528260400,543981600,55971E4,575431200,591159600,606880800,622609200,638330400,654663600,670381200,686109600,701830800,717559200,733280400,749008800,76473E4,780458400,796179600,811908E3,
|
|
828234E3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482E3,1004234400,1017536400,1035684E3,1048986E3,1067133600,1080435600,1099188E3,1111885200,1130637600,1143334800,1162087200,1167609600,1174791600,1193544E3,1206846E3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1301281200,1319943600,1332644400,1351396800,1364698800,1382846400,1396148400,1396234800,1414292400,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,315569527201],offset:[6952,7016,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,14400,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,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,7200,10800,7200,10800,7200,10800,7200,10800,7200,7200,7200,7200,10800,7200,10800,7200,7200,7200,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]},"Australia/Sydney":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364E3,-844639200,-828309600,-813189600,31536E3,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,315569530801],offset:[36292,36E3,39600,36E3,39600,36E3,39600,36E3,39600,36E3,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,315569527201],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,315569527201],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,315569527201],offset:[24925,24925,25200,25200,26400,27E3,32400,27E3,27E3,28800]},"Asia/Shanghai":{time:[-2177452800,-933465600,-923097600,-908755200,-891561600,-662688E3,515548800,52704E4,
|
|
545184E3,558489600,576633600,589939200,608688E3,621993600,640137600,653443200,671587200,684892800,315569527201],offset:[29143,28800,32400,28800,32400,28800,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,315569527201],offset:[30472,30600,32400,30600,32400,32400,32400,28800,32400,28800,30600,
|
|
32400,36E3,32400,36E3,32400]},"Asia/Bangkok":{time:[-2840140800,-1570060800,315569527201],offset:[24124,24124,25200]},"Asia/Jerusalem":{time:[-2840140800,-1640995200,-933638400,-857347200,-844293600,-825811200,-812678400,-794188800,-779846400,-762645600,-748303200,-731116800,-681955200,-673228800,-667951200,-65232E4,-636415200,-62208E4,-608936400,-59184E4,-572475600,-558568800,-542840400,-527724E3,-514414800,-490838400,-482976E3,-459468E3,-451526400,-428544E3,-418251600,-400024800,-387417600,142387200,
|
|
150854400,167184E3,178675200,482284800,495590400,516758400,526435200,545443200,558489600,576633600,589334400,609897600,620784E3,638323200,651628800,669772800,683683200,701827200,715737600,733708800,747187200,765158400,778032E3,796608E3,810086400,826848E3,842832E3,858902400,874195200,890352E3,90504E4,923018400,936324E3,955677600,970794E3,986778E3,1001293200,1017363600,1033952400,1048813200,1065142800,1081299600,1095814800,1112320800,1128823200,1143770400,1159668E3,117522E4,1189908E3,1206669600,1223172E3,
|
|
1238119200,1254016800,1269568800,1284256800,1301623200,1317520800,1333072800,1348365600,1364522400,1382839200,1395972E3,1414288800,1427421600,1445738400,1458871200,1477792800,1490320800,1509242400,1521770400,1540692E3,1553824800,1572141600,1585274400,1603591200,1616724E3,1635645600,1648173600,1667095200,1679623200,1698544800,1711677600,1729994400,1743127200,1761444E3,1774576800,1792893600,1806026400,1824948E3,1837476E3,1856397600,1868925600,1887847200,190098E4,1919296800,315569527201],offset:[8454,
|
|
8440,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,14400,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,10800,7200]},"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,315569527201],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/Kolkata":{time:[-2840140800,-891561600,-872035200,-862617600,-764121600,315569527201],offset:[21208,21200,23400,19800,19800,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,135747E3,151471800,167196600,182921400,
|
|
198646200,214371E3,295414200,309324600,315569527201],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,32400,28800,32400,28800,32400,28800,32400,28800]}};"undefined"!==
|
|
typeof module&&module.exports?module.exports=a:this.TzData=a;return a}(this);this.PineJsCalendar=PineJsCalendar=function(){function a(a){var c=b[a];c||("UTC"!==a&&"Etc/UTC"!==a&&console.error("unknown timezone: "+a),c={time:[],offset:[]});c.time.length!==c.offset.length&&(console.error("timezone transition table doesn't match offset table"),c={time:[],offset:[]});if(!c.time_utc){a=c.time;for(var f=c.offset,g=a.length,h=Array(g),k=0;k<g;k++)a[k]*=1E3,f[k]*=1E3,h[k]=a[k]-f[k];c.time_utc=h}this.tz=c}var b=this.TzData?this.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 g=a.length;if(0===g)a=-1;else{for(var h=0,k=g-1,l=(h+k)/2|0;;){if(a[l]>c){if(k=l-1,k<h){a=l;break a}}else if(h=l+1,k<h){a=l<g-1?l+1:-1;break a}l=(h+k)/2|0}a=void 0}}return-1===a?0:b[a]};var c={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)/c.secondsPerDay|0)+1},get_week_of_year:function(a){var b=Date.UTC(a.getUTCFullYear(),0,1,0,0,0,0);a=c.clone(a);c.set_hms(a,0,0,0,0);a.setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7));return((a.getTime()-b)/c.secondsPerDay+1)/7|0},get_minutes_from_midnight:function(a){return 60*c.get_hours(a)+c.get_minutes(a)},set_hms:function(a,b,c,g,h){a.setUTCHours(b);a.setUTCMinutes(c);a.setUTCSeconds(g);a.setUTCMilliseconds(h)},add_date:function(a,b){a.setTime(a.getTime()+b*
|
|
c.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 c.YEAR:return c.get_year(a);case c.MONTH:return c.get_month(a);case c.DAY_OF_MONTH:return c.get_day_of_month(a);case c.WEEK_OF_YEAR:return c.get_week_of_year(a);case c.DAY_OF_WEEK:return c.get_day_of_week(a);case c.HOUR_OF_DAY:return c.get_hours(a);
|
|
case c.MINUTE:return c.get_minutes(a);case c.DAY_OF_YEAR:return c.get_day_of_year(a);case c.SECOND:return c.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,g){return new Date(Date.UTC(b,c,g))},cal_to_utc:function(a,b){var c=b.getTime(),g=a.offset_loc(c);return c-g},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=c:this.PineJsCalendar=c;return c}(this);this.PineJsBarBuilder=PineJsBarBuilder=function(){function a(a,b){switch(a){case "D":return new s(b);case "W":return new A(b);case "M":return new B(b)}console.error("unknown dwm resolution: "+a);return null}function b(a,b,c,d){var e=b;a.moveTo(e);for(var f=[],g=0,h=0;!d(f,e);){if(20<g)throw"Internal error 0x10 while extrapolating "+c;e=a.indexOfBar(e);if(e===K)e=a.startOfBar("front"==c?0:K);else if(e===D)e=a.startOfBar("front"==c?D:0);else{var k=a.startOfBar(e);if(k!=b){if(h&&h==k)throw"Internal error 0x11 while extrapolating "+
|
|
c;h=k;g=0;f.push(k)}e="front"==c?a.startOfBar(e+1):a.startOfBar(e-1)}a.moveTo(e);g++}return"front"==c?f:f.reverse()}function c(a){if(isNaN(a))return NaN;var b=this.indexOfBar(a);b===D&&(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,d){c=c||"front";var e=F.get_day_of_week(b),f=F.get_minutes_from_midnight(b),g=a.findSession(e,f),h=g.start(),k=g.dayOfWeek(),l=g.isOvernight(),m=0;"front"==c?m=(k-e+7)%7-(l?1:0):(!a.isTradedOnWeekEnds&&h>f&&(m--,e=F.shift_day(e,-1)),m-=l?1:0,a.isTradedOnWeekEnds||(e==F.SUNDAY?m-=2:e==F.SATURDAY&&(m-=1)));0!==m&&F.add_date(b,m);F.set_hms(b,h/60|0,h%60,0,0);a=g.length();c=new Date(b.valueOf()+6E4*a);b=d.offset_loc(b)/6E4;d=d.offset_loc(c)/6E4;
|
|
return a+(b-d)}function g(a,b){var c=F.get_day_of_week(b),d=F.get_minutes_from_midnight(b);a.findSession(c,d).isOvernight()&&F.add_date(b,1);F.set_hms(b,0,0,0,0);return b}function h(a,b,c,d){c=F.clone(c);f(b,c,d,a);return F.cal_to_utc(a,c)}function k(a,b){var c=F.get_day_of_week(b)-a.firstDayOfWeek;return 0>c?c+7:c}function l(a,b){var c=b+a.firstDayOfWeek;return c>F.SATURDAY?c-F.SATURDAY:c}function m(a,b){var c=F.get_day_of_year(b)-1,d=k(a,b)-c%7;if(0==d)return c/7|0;0<=d&&(d-=7);return(d+c)/7|0}
|
|
function q(a,b,c){for(var d=0;b<c;++b)d+=a.isWeekEnd(l(a,b))?1:0;return d}function n(a,b){var c=new Date(b,11,31,23,59),d=F.days_per_year(b)-t(a,c);F.get_day_of_week(c)!==F.SUNDAY&&F.get_day_of_week(c)!==F.SATURDAY||d--;return d}function t(a,b){var c=F.get_day_of_year(b)-1,d=k(a,b),e=d-c%7;0>e&&(e+=7);var f=0;c<7-e?f+=q(a,e,d):(c=0==e?0:q(a,e,7),f+=q(a,0,d)+c);return f+m(a,b)*a.weekEndsCount()}function u(){}function z(a){this.sessionsSpec=a}function s(a){this.session=a}function A(a){this.session=
|
|
a}function B(a){this.session=a}function w(a,b,c){this._dayOfWeek=a;this._start=b;this._length=c}function v(a,b){return a.compareTo(b)}function C(a){function b(a){var d=a.split(";");if(2<d.length)return console.error("bad session spec: "+a),a;if(1==d.length)return a;var e=1,f=parseInt(d[0]);isNaN(f)&&(e=0,f=parseInt(d[1]));if(f<F.SUNDAY||f>F.SATURDAY)return console.error("bad session spec: "+a),a;c.firstDayOfWeek=f;return d[e]}var c=this;a=a||"0000-0000";this.entries=[];this.firstDayOfWeek=F.MONDAY;
|
|
if("24x7"===a.toLowerCase())r.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?P:G(b[1])).forEach(function(a){c&&e[a]||(e[a]=b[0])},this)},this);r.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(v)}function G(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 I(){}function E(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 K=-1,D=-2,F=this.PineJsCalendar?this.PineJsCalendar:
|
|
require("./calendar.js");d.prototype.alignTime=c;d.prototype.indexOfBar=function(a){return a<this.sessionStart?K:a>=this.sessionEnd?D:F.time_minutes_diff(a,this.sessionStart)/this.period|0};d.prototype.startOfBar=function(a){return a===D?this.sessionEnd:0>a?this.prevSessionEnd+F.time_minutes(this.period*a):this.sessionStart+F.time_minutes(this.period*a)};d.prototype.isLastBar=function(a,b){var c=this.sessionStart+F.time_minutes(this.period*(a+1)-1);return b>=c};d.prototype.moveTo=function(a){var b=
|
|
this.session.timezone,c=F.utc_to_cal(b,a);a=this.session.spec;var d=f(a,c,"front",this.session.timezone);this.sessionStart=F.cal_to_utc(b,c);this.sessionEnd=this.sessionStart+F.time_minutes(d);c=F.utc_to_cal(b,this.sessionStart-F.time_minutes(this.period));a=f(a,c,"back",this.session.timezone);b=F.cal_to_utc(b,c);this.prevSessionEnd=b+F.time_minutes(a);if(b==this.sessionStart)throw"Internal error 0x12";};e.prototype.alignTime=c;e.prototype.indexOfBar=function(a){return a<this.periodStart?K:a>=this.periodEnd?
|
|
D:0};e.prototype.startOfBar=function(a){return a===D||0<a?this.periodEnd:-3===a?this.periodLastBarStart:a===K?this.prevPeriodStart:this.periodStart};e.prototype.isLastBar=function(a,b){return b>=this.periodLastBarStart};e.prototype.moveTo=function(a){a=F.utc_to_cal(this.sessionSrc.timezone,a);var b=g(this.sessionSrc.spec,a);a=F.get_year(b);var c=(this.builder.indexOfPeriod(b)/this.period|0)*this.period,d=c+this.period,b=this.sessionTgt.spec,e=this.sessionTgt.timezone;this.periodStart=h(e,b,this.builder.startOfPeriod(e,
|
|
c,a));this.prevPeriodStart=h(e,b,this.builder.startOfPeriod(e,c-this.period,a),"back");a=this.builder.startOfPeriod(e,d,a);this.periodEnd=h(e,b,a);F.add_date(a,-1);this.moveToPrevWorkDay(this.sessionTgt.spec,a);this.periodLastBarStart=h(e,b,a);if(this.periodLastBarStart<this.periodStart||this.periodLastBarStart===this.periodEnd)this.periodLastBarStart=this.periodStart};e.prototype.moveToPrevWorkDay=function(a,b){for(;a.isWeekEnd(F.get_day_of_week(b));)F.add_date(b,-1)};u.prototype.indexOfPeriod=function(a){return F.get_day_of_year(a)-
|
|
1};u.prototype.startOfPeriod=function(a,b,c){a=F.get_cal(a,c,F.JANUARY,1);c=F.get_days_per_year(a);F.add_date(a,Math.min(b,c));return a};z.prototype.uber=new u;z.prototype.indexOfPeriod=function(a){return this.uber.indexOfPeriod(a)-t(this.sessionsSpec,a)};z.prototype.startOfPeriod=function(a,b,c){function d(a,b){for(var c=0,e=a;7>e&&(f.sessionsSpec.isWeekEnd(l(f.sessionsSpec,e))||!(0>--b));++e)c++;return c}function e(a,b,c){var d=0,g=0;for(a=c%(7-f.sessionsSpec.weekEndsCount())-(0==a?0:b.businessDays);7>
|
|
g&&0<a;++g){var h=f.sessionsSpec.isWeekEnd(l(f.sessionsSpec,g)),d=d+(h?1:0);a-=h?0:1}d=b.weekEnds+d;b=(c-b.businessDays)/(7-f.sessionsSpec.weekEndsCount())|0;b=d+f.sessionsSpec.weekEndsCount()*b;return c+b}0>b&&(c--,b=n(this.sessionsSpec,c)+b);var f=this,g=F.get_cal(a,c,F.JANUARY,1),g=k(this.sessionsSpec,g),h=new function(a,b){this.weekEnds=q(a,b,7);this.calendarDays=7-b;this.businessDays=this.calendarDays-this.weekEnds}(this.sessionsSpec,g);b=b<h.businessDays?d(g,b):e(g,h,b);return this.uber.startOfPeriod(a,
|
|
b,c)};s.prototype.indexOfPeriod=function(a){return this.builder().indexOfPeriod(a)};s.prototype.startOfPeriod=function(a,b,c){return this.builder().startOfPeriod(a,b,c)};s.prototype.builder=function(){this._builder||(this._builder=this.session.spec.hasWeekEnds()?new z(this.session.spec):new u);return this._builder};A.prototype.indexOfPeriod=function(a){return m(this.session.spec,a)};A.prototype.startOfPeriod=function(a,b,c){var d=F.get_cal(a,c,F.JANUARY,1),e=k(this.session.spec,d);b=0===e?7*b:7*(b+
|
|
1)-e;e=F.get_days_per_year(d);if(b>e)return this.startOfPeriod(a,0,c+1);F.add_date(d,b);return d};B.prototype.indexOfPeriod=function(a){return F.get_month(a)};B.prototype.startOfPeriod=function(a,b,c){if(0>b){var d=(-b+11)/12|0;c-=d;b+=12*d}if(b>F.DECEMBER)return F.get_cal(a,c+1,F.JANUARY,1);a=F.get_cal(a,c,b,1);b=k(this.session.spec,a);4<b&&F.add_date(a,7-b);return a};w.prototype.start=function(){return 0>this._start?this._start+F.minutesPerDay:this._start};w.prototype.isOvernight=function(){return 0>
|
|
this._start};w.prototype.dayOfWeek=function(){return this._dayOfWeek};w.prototype.length=function(){return this._length};w.prototype.weight=function(){return this._dayOfWeek*F.minutesPerDay+this._start};w.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 P=[F.MONDAY,F.TUESDAY,F.WEDNESDAY,F.THURSDAY,F.FRIDAY],r=[F.SUNDAY,F.MONDAY,F.TUESDAY,F.WEDNESDAY,F.THURSDAY,F.FRIDAY,F.SATURDAY];C.prototype.addSessionEntry=function(a,b,c){c<=b&&0!=
|
|
b&&(b-=F.minutesPerDay);this.entries.push(new w(a,b,c==b?F.minutesPerDay:c-b))};C.prototype.isWeekEnd=function(a){var b=E(this.entries,new w(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=E(this.entries,new w(a,b,0),v);return-1===c?0:c};C.prototype.findSession=function(a,b){return this.entries[this.indexOfSession(a,b)]};I.prototype.init=function(a,b){this.timezone="string"===typeof a?F.get_timezone(a):a;this.spec=new C(b);return this};var R={PRE_SESSION:K,POST_SESSION:D,LASTBAR_SESSION:-3,newBarBuilder:function(b,c,f,g){return""===b?new d(c,f):new e(f,g,c,a(b,f))},Session:I,alignDWMPeriodsBack:function(b,
|
|
c,d,e,f){b=F.get_timezone(b);var k=(new I).init(b,c);c=k.spec;d=a(d,k);f=F.utc_to_cal(b,f);k=g(c,f);f=F.get_year(k);e=d.indexOfPeriod(k)-e;return h(b,c,d.startOfPeriod(b,e,f))},extrapolateBarsBackByCount:function(a,c,d){return b(a,c,"back",function(a,b){return a.length>=d})},extrapolateBarsFrontByCount:function(a,c,d){return b(a,c,"front",function(a,b){return a.length>=d})},extrapolateBarsFrontToTime:function(a,c,d){return b(a,c,"front",function(a,b){return b>d})},lower_bound:E};"undefined"!==typeof module&&
|
|
module.exports?module.exports=R:this.PineJsBarBuilder=R;return R}.call(this);this.PineJS=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=s.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(s.high(d));var e=d.new_var(s.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=s.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 z.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 q(a,b){this.period=a;this.generateEmptyBars=!!b}function n(){}function t(){}var u=this.PineJsCalendar?this.PineJsCalendar:require("./calendar.js"),z=this.PineJsBarBuilder?this.PineJsBarBuilder:require("./barbuilder.js"),s={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)&&
|
|
!s.isZero(a)},eq:function(a,b){return s.isZero(a-b)},neq:function(a,b){return!s.eq(a,b)},ge:function(a,b){return s.isZero(a-b)||a>b},gt:function(a,b){return!s.isZero(a-b)&&a>b},lt:function(a,b){return!s.isZero(a-b)&&a<b},le:function(a,b){return s.isZero(a-b)||a<b},and:function(a,b){return isNaN(a)||isNaN(b)?NaN:s.isZero(a)||s.isZero(b)?0:1},or:function(a,b){return isNaN(a)||isNaN(b)?NaN:s.isZero(a)&&s.isZero(b)?0:1},not:function(a){return isNaN(a)?NaN:s.isZero(a)?1:0}};s.max=Math.max;s.min=Math.min;
|
|
s.pow=Math.pow;s.abs=Math.abs;s.log=Math.log;s.log10=function(a){return Math.log(a)/Math.LN10};s.sqrt=Math.sqrt;s.sign=function(a){return isNaN(a)?NaN:s.isZero(a)?0:0<a?1:-1};s.exp=Math.exp;s.sin=Math.sin;s.cos=Math.cos;s.tan=Math.tan;s.asin=Math.asin;s.acos=Math.acos;s.atan=Math.atan;s.floor=Math.floor;s.ceil=Math.ceil;s.round=Math.round;s.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};s.open=function(a){return a.symbol.open};
|
|
s.high=function(a){return a.symbol.high};s.low=function(a){return a.symbol.low};s.close=function(a){return a.symbol.close};s.hl2=function(a){return(a.symbol.high+a.symbol.low)/2};s.hlc3=function(a){return(a.symbol.high+a.symbol.low+a.symbol.close)/3};s.ohlc4=function(a){return(a.symbol.open+a.symbol.high+a.symbol.low+a.symbol.close)/4};s.volume=function(a){return a.symbol.volume};s.time=function(a,b,c){return a.symbol.bartime(b,c)};s.period=function(a){return a.symbol.period};s.tickerid=function(a){return a.symbol.tickerid};
|
|
s.ticker=function(a){return a.symbol.ticker};s.interval=function(a){return a.symbol.interval};s.isdwm=function(a){return a.symbol.isdwm()};s.isintraday=function(a){return!a.symbol.isdwm()};s.isdaily=function(a){return"D"===a.symbol.resolution};s.isweekly=function(a){return"W"===a.symbol.resolution};s.ismonthly=function(a){return"M"===a.symbol.resolution};s.year=function(a,b){return s.timepart(a.symbol,u.YEAR,b)};s.month=function(a,b){return s.timepart(a.symbol,u.MONTH,b)};s.weekofyear=function(a,
|
|
b){return s.timepart(a.symbol,u.WEEK_OF_YEAR,b)};s.dayofmonth=function(a,b){return s.timepart(a.symbol,u.DAY_OF_MONTH,b)};s.dayofweek=function(a,b){return s.timepart(a.symbol,u.DAY_OF_WEEK,b)};s.hour=function(a,b){return s.timepart(a.symbol,u.HOUR_OF_DAY,b)};s.minute=function(a,b){return s.timepart(a.symbol,u.MINUTE,b)};s.second=function(a,b){return s.timepart(a.symbol,u.SECOND,b)};s.iff=function(a,b,c){return s.not(a)?c:b};s.rising=function(a,b){for(var c=1;c<b+1;++c)if(a.get(c)>a.get(0))return 0;
|
|
return 1};s.falling=function(a,b){for(var c=1;c<b+1;++c)if(a.get(c)<a.get(0))return 0;return 1};s.timepart=function(a,b,c){a=u.utc_to_cal(a.timezone,c||a.bartime());return u.get_part(a,b)};s.rsi=function(a,b){return s.isZero(b)?100:s.isZero(a)?0:100-100/(1+a/b)};s.sum=function(a,b,c){c=c.new_var();a=s.nz(a.get())+s.nz(c.get(1))-s.nz(a.get(b));c.set(a);return a};s.sma=function(a,b,c){c=s.sum(a,b,c);return s.na(a.get(b-1))?NaN:c/b};s.rma=function(a,b,c){var d=s.sum(a,b,c),e=b-1,f=a.get(e);c=c.new_var();
|
|
var g=c.get(1);a=a.get();b=s.na(f)?NaN:s.na(g)?d/b:(a+g*e)/b;c.set(b);return b};s.fixnan=function(a,b){var c=b.new_var();if(isNaN(a))return c.get(1);c.set(a);return a};s.tr=function(a){var b=a.new_var(s.close(a));return s.max(s.max(s.high(a)-s.low(a),s.abs(s.high(a)-b.get(1))),s.abs(s.low(a)-b.get(1)))};s.atr=function(a,b){var c=b.new_var(s.tr(b));return s.sma(c,a,b)};s.ema=function(a,b,c){var d=s.sum(a,b,c);c=c.new_var();var e=a.get(0);a=a.get(b-1);var f=c.get(1);b=s.na(a)?NaN:s.na(f)?d/b:2*(e-f)/
|
|
(b+1)+f;c.set(b);return b};s.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))};s.vwma=function(a,b,c){var d=c.new_var(s.volume(c));a=c.new_var(a.get(0)*s.volume(c));return s.sma(a,b,c)/s.sma(d,b,c)};s.swma=function(a,b){return(a.get(0)+2*a.get(1)+2*a.get(2)+a.get(3))/6};s.lowestbars=function(b,c,d){return-a(b,c,d,function(a,b){return s.lt(a,b)},Number.MAX_VALUE).index};s.lowest=function(b,c,d){return a(b,c,d,function(a,b){return s.lt(a,b)},Number.MAX_VALUE).value};
|
|
s.highestbars=function(b,c,d){return-a(b,c,d,function(a,b){return s.gt(a,b)},Number.MIN_VALUE).index};s.highest=function(b,c,d){return a(b,c,d,function(a,b){return s.gt(a,b)},Number.MIN_VALUE).value};s.cum=function(a,b){var c=b.new_var(),d=s.nz(c.get(1))+a;c.set(d);return d};s.accdist=function(a){s.open(a);var b=s.high(a),c=s.low(a),d=s.close(a),e=s.volume(a);return s.cum(d==b&&d==c||b==c?0:e*(2*d-c-b)/(b-c),a)};s.correlation=function(a,b,c,d){var e=s.sma(a,c,d),f=s.sma(b,c,d),g=d.new_var(a.get()*
|
|
b.get());return(s.sma(g,c,d)-e*f)/Math.sqrt(s.variance2(a,e,c)*s.variance2(b,f,c))};s.stoch=function(a,c,d,e,f){c=s.highest(c,e);d=s.lowest(d,e);return s.fixnan(b(a.get()-d,c-d),f)};s.tsi=function(a,b,c,d){var e=d.new_var(s.change(a));a=d.new_var(s.abs(s.change(a)));e=d.new_var(s.ema(e,c,d));c=d.new_var(s.ema(a,c,d));e=s.ema(e,b,d);b=s.ema(c,b,d);return e/b};s.cross=function(a,b,c){if(isNaN(a)||isNaN(b))return!1;a=c.new_var(0>a-b?-1:0==a-b?0:1);return!isNaN(a.get(1))&&a.get(1)!=a.get()};s.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)};s.sar=function(a,b,c,d){function e(b,c){var d=n.get();q.set(b);n.set(c);t.set(1E3*a);u.set(d);return d}var f=s.high(d),g=s.low(d),h=s.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(),q=d.new_var(),t=d.new_var(),u=d.new_var();d=u.get(1);if(isNaN(m))return NaN;isNaN(d)&&(s.ge(h,m)?(q.set(1),n.set(Math.max(f,
|
|
k)),d=Math.min(g,l)):(q.set(-1),d=Math.max(f,k),n.set(Math.min(g,l))),t.set(1E3*a));if(1==q.get()){if(s.gt(f,n.get())&&(n.set(f),t.set(Math.min(t.get()+1E3*b,1E3*c))),s.le(g,d))return e(-1,g)}else if(s.lt(g,n.get())&&(n.set(g),t.set(Math.min(t.get()+1E3*b,1E3*c))),s.ge(f,d))return e(1,f);b=d+t.get()*(n.get()-d)/1E3;1==q.get()?s.ge(b,g)&&(b=g-1E-7):s.le(b,f)&&(b=f+1E-7);u.set(b);return b};s.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};s.wvap=function(a,b){return a.get()-a.get(1)};s.change=function(a){return a.get()-a.get(1)};s.roc=function(a,b){var c=a.get(b);return 100*(a.get()-c)/c};s.dev=function(a,b,c){c=s.sma(a,b,c);return s.dev2(a,b,c)};s.dev2=function(a,b,c){for(var d=0,e=0;e<b;e++)var f=a.get(e),f=s.abs(f-c),d=d+f;return d/b};s.stdev=function(a,b,c){a=s.variance(a,b,c);return s.sqrt(a)};s.variance=function(a,
|
|
b,c){c=s.sma(a,b,c);return s.variance2(a,c,b)};s.variance2=function(a,b,c){for(var d=0,e=0;e<c;e++)var f=a.get(e),f=s.abs(f-b),d=d+f*f;return d/c};s.percentrank=function(a,b){if(s.na(a.get(b-1)))return NaN;for(var c=0,d=a.get(),e=1;e<b;e++){var f=a.get(e);s.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())};s.zigzag=function(a,b,c){return(new d(a,b,c)).lastPrice()};s.zigzagbars=
|
|
function(a,b,c){a=new d(a,b,c);return-1==a.lastIndex()?NaN:a.lastIndex()-s.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)};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=s.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=s.na(this.mindepth)?s.max_series_size:s.min(this.mindepth+1,s.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),s.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(s.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,isIntraday:a,range:c}};g.newBarBuilder=function(a,b,c){a=g.parsePeriod(a);return z.newBarBuilder(a.resolution,a.interval,b,c)};g.newSession=function(a,b){var c=u.get_timezone(a);
|
|
return(new z.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=u.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 z.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;var d=u.utc_to_cal(this.timezone,c),f=this.session.spec,h=u.get_day_of_week(d),e=u.get_minutes_from_midnight(d),h=f.findSession(h,
|
|
e),f=h.isOvernight(),e=h.start()<=e;if(!f||!e)return c;u.add_date(d,1);return u.cal_to_utc(this.timezone,d)};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()&&(g.inputSessionForDWM||
|
|
1<this.symbols.length)&&a.enable_dwm_aligning(this.symbols[0].session,g.inputSessionForDWM||a.session);return a};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(){var a=this.host;new h(a.tickerid,a.period,a.periodBase||a.period,this,a.body,a.out,a.input);for(var b=this,c=[],d=this.symbols,e=0;e<d.length;e++)(function(){var f=
|
|
d[e],g=e,f=k.feed.subscribe(f.tickerid,f.period,f.periodBase,function(a){b.update(g,a)},a.onErrorCallback,a.symbolInfo,a.rangeExtension);c.push(f)})();this.subscription=c};k.prototype.stop=function(){for(var a=this.subscription,b=0;b<a.length;b++)k.feed.unsubscribe(a[b])};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()};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};q.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};q.prototype.extrapolate=function(a,b){return isNaN(a)||isNaN(b)?void 0:z.extrapolateBarsFrontToTime(this.bbEmptyBars,a,b)};q.prototype.main=function(a){var b=a.symbol.time,c=this.bb.alignTime(b),d=a.new_var(c),e=s.na(c),f=d.get(1),g=s.na(f)?1:s.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),q=k.get(1),t=l.get(1),m=e?NaN:g?s.open(a):m,n=e?NaN:g?s.high(a):s.max(s.high(a),n),q=e?NaN:g?s.low(a):s.min(s.low(a),q),u=e?NaN:s.close(a),t=e?NaN:g?s.volume(a):s.volume(a)+t,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(s.close(a)).get(1);a=f instanceof Array?a:NaN;d.set(m);h.set(n);k.set(q);l.set(t);return[c,m,n,q,u,t,e,b,f,a]};n.prototype.main=function(a){var b=a.new_var(s.open(a)),c=a.new_var(s.close(a)),
|
|
d=b.get(1),e=c.get(1),c=s.ohlc4(a),d=s.na(b.get(1))?(s.open(a)+s.close(a))/2:(d+e)/2;b.set(d);var b=s.max(s.high(a),s.max(d,c)),e=s.min(s.low(a),s.min(d,c)),f=s.volume(a);a=a.symbol;return[a.time,d,b,e,c,f,a.updatetime,a.isBarClosed]};t.prototype.main=function(a){var b=s.open(a),c=s.high(a),d=s.low(a),e=s.close(a);a=s.volume(a);return[b,c,d,e,a]};var A={Std:s,Series:f,Symbol:g,SymbolInfo:function(a,b){this.timezone=a||"America/New_York";this.session=b||"0000-0000"},StudyEngine:l,BarSet:m,OHLCV:t,
|
|
BarBuilder:q,HeikenAshi:n,setupFeed:function(a,b){k.feed=a;b&&(g.inputSessionForDWM=g.newSession("UTC","24x7"))}};"undefined"!==typeof module&&module.exports?module.exports=A:this.PineJS=A;return A}(this);PineJSFeed=function(){function a(a){this.host=a;this.cache={}}function b(a){return a.has_empty_bars||a.force_session_rebuild}function c(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 d.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 d=this.PineJS?this.PineJS:require("./iljs.js"),e=this.PineJsBarBuilder?
|
|
this.PineJsBarBuilder:require("./barbuilder.js"),f=d.Symbol,g=d.StudyEngine,h=d.BarBuilder,k=d.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,c,d,e,f,g){var h;h=b(g)?"_":"";h=a+c+d+h;var k=this.getCache(h);k||(k=this.createItem(a,c,d,g),this.putCache(h,k));k.listeners.addListener(e,f);return{key:h,listener:e}};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.hasOwnProperty(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];delete this.cache[c];d.stop()}this.removeUnused()}};a.prototype.rebuildFrom=function(a,b,c){a=f.parsePeriod(a);b=f.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,d,e,f){var g=new q;a=c(a);if(a.builder)return new m(g,a.symbol,d,e,a.builder,f);var k=this.rebuildFrom(d,
|
|
e,f),n=b(f);return d!==k||n?(e=f.has_empty_bars,f=$.extend({},f),n&&(f.has_empty_bars=!1,f.force_session_rebuild=!1),new m(g,a.symbol,d,k,new h(d,e),f)):new l(g,a.symbol,d,e,a.session&&"extended"!==a.session,this.host,f)};var l=function(a,b,c,d,e,f,g){this.listeners=a;this.host=f;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)})};l.prototype.stop=function(){this.host.unsubscribe(this.subs)};l.prototype.calculateFromTo=function(a,b,c){var d=f.parsePeriod(b);c=a.expired?1E3*a.expiration_date||(new Date).valueOf():(new Date).valueOf();var g,h;""===d.resolution?(g=d.interval,h="D"):(g=12*("D"===d.resolution?1:"W"===d.resolution?5:30)*d.interval,h="M");d.range?(g=d.range.interval,h=d.range.resolution):this.host.calculateHistoryDepth&&(d=this.host.calculateHistoryDepth(b,h,g))&&(d.intervalBack&&
|
|
(g=d.intervalBack),d.resolutionBack&&(h=d.resolutionBack));g=e.alignDWMPeriodsBack(a.timezone,a.sessionString,h,g,c);this.host.getRangeExtension&&(h=this.host.getRangeExtension(),0<h&&(a=PineJS.Symbol.newSession(a.timezone,a.sessionString),b=PineJS.Symbol.newBarBuilder(b,a),g=PineJsBarBuilder.extrapolateBarsBackByCount(b,g,h)[0]));return{from:g,to:c+6E4}};var m=function(a,b,c,d,e,f){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 g({tickerid:b,period:d,periodBase:c,body:e,symbolInfo:f,recalc:function(){h._recalc()},out:function(a,b){h._out(a,b)},onErrorCallback:function(a){h.listeners.onError(a)}})}};m.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")};m.prototype._recalc=function(){this.isRecalculated&&console.error("recalc called twice!");this.barset&&this.listeners.fire(this.barset);this.isRecalculated=!0};m.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 k(a.info));var e=b[8];if(e instanceof Array)for(var f=0;f<e.length;f++){var g=b[9],h=e[f];this.barset.add({time:h,open:g,high:g,low:g,close:g,volume:0,updatetime:h},!0);this.isRecalculated&&this.listeners.fire(this.barset)}this.barset.add(c,d);this.isRecalculated&&this.listeners.fire(this.barset)}};var q=function(){this.listeners=[]};q.prototype.listenersCount=
|
|
function(){return this.listeners.reduce(function(a,b){return a+(b?1:0)},0)};q.prototype.addListener=function(a,b){this.listeners.push({dataListener:a,onErrorCallback:b});this.barset&&a(this.barset);this.errorMsg&&b(this.errorMsg)};q.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])};q.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)}};q.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,c){a.instance=new a(b);d.setupFeed(a.instance,c)},parseSymbol:c,unsubscribeUnused:function(){a.instance.removeUnused()}};"undefined"!==typeof module&&module.exports?module.exports=n:this.PineJSFeed=n;return n}(this);Q82.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.sma(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:0.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:0.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:0.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)/(0.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.sma(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),q=PineJS.Std.close(this._context),n=this._context.new_var(q),c=PineJS.Std.roc(n,c),c=this._context.new_var(c),g=PineJS.Std.sma(c,g,this._context),c=this._context.new_var(q),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(q),
|
|
e=PineJS.Std.roc(d,e),e=this._context.new_var(e),k=PineJS.Std.sma(e,k,this._context),q=this._context.new_var(q),f=PineJS.Std.roc(q,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:0.02,in_1:0.02,in_2:0.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:0.02,type:"float",min:-1E12,max:1E12},{id:"in_1",name:"increment",defval:0.02,type:"float",min:-1E12,max:1E12},{id:"in_2",name:"maximum",defval:0.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 100*((a-b)/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),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 100*(a/(a+b))};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:0.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:0.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)]}}}];Q82.studyLibrary=Q82.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:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0}},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]}}}]);Q81=function(){this._sets={}};Q81.prototype._cacheKey=function(a,b){return a};Q81.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 c.push(d[g][0]);this._sets[b].push({guid:a,points:c})};
|
|
Q81.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}};Q81.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};
|
|
Q81.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)}}};Q81.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].index:c.indexOfBar(b,d)};Q82.ExtrapolationManager=function(){this._storages={}};Q82.ExtrapolationManager.prototype._storageKey=function(a,b,c){return a+","+b+","+c};Q82.ExtrapolationManager.prototype.remove=function(a,b,c){delete this._storages[this._storageKey(a,b,c)]};Q82.ExtrapolationManager.prototype.storage=function(a,b,c){b=this._storageKey(a,b,c);if(this._storages[b])return this._storages[b];this._storages[b]=new Q80(ChartapiMessagerInstances[a],c);return this._storages[b]};
|
|
Q80=function(a,b){this._chartApiMessager=a;this._lastRealBarIndex=this._lastRealBarTime=null;this._resolution=b;this._extrapolatedBarsCache=[];this._onReadyCallbacks=[]};Q80.prototype.ready=function(){return!!this._lastRealBarTime};Q80.prototype.rebuild=function(a,b){this._lastRealBarTime=a;this._extrapolatedBarsCache=[];this.ensureExtrapolatedToBar(b,this._lastRealBarIndex)};
|
|
Q80.prototype.getPointTimeUTC=function(a,b,c){a=this.indexOfBar(a,c)-this._lastRealBarIndex;this.ensureExtrapolatedToBar(c,a+b+1);return this._extrapolatedBarsCache[a+b]};Q80.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};
|
|
Q80.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=PineJsCalendar.get_timezone(a.timezone),e=0;e<c.length;++e){var f=PineJsCalendar.cal_to_utc(d,new Date(c[e]));c[e]=f/1E3}c[0]==this._lastRealBarTime/1E3&&(c=c.slice(1));this._extrapolatedBarsCache=c;d=c.slice(0);d.sort();for(e=0;e<d.length-1;++e)d[e]==d[e+1]&&console.error("Duplicating extrapolated bars: duplicated "+
|
|
new Date(1E3*d[e]));this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,c,a)}else this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,this._extrapolatedBarsCache,a)};Q80.prototype.onTickmarksNeeded=function(a,b){if(this.ready())this.ensureExtrapolatedToBar(a,b);else{var c=this;this._onReadyCallbacks.push(function(){c.ensureExtrapolatedToBar(a,b)})}};
|
|
Q80.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)})};
|
|
Q80.prototype._ensureExtrapolatedToTime=function(a,b){var c=this;return this._extrapolateData(a,function(d){return d>=b||!c._shouldExtrapolateMore()?null:PineJsBarBuilder.extrapolateBarsFrontToTime(c.newBarBuilder(a),d,b)})};Q80.prototype.newBarBuilder=function(a){a=PineJS.Symbol.newSession(a.timezone,a.session);return PineJS.Symbol.newBarBuilder(this._resolution,a)};Q80.prototype._shouldExtrapolateMore=function(){return 100>this._extrapolatedBarsCache.length};
|
|
Q80.prototype.setLastBarTime=function(a,b){this._lastRealBarTime=b;this._lastRealBarIndex=a;for(var c=0;c<this._onReadyCallbacks.length;++c)this._onReadyCallbacks[c]();this._onReadyCallbacks=[]};Q79=function(a){var b=this;this._studiesCache={};this._metainfoCache=[];this._symbolInfoCache={};this._extrapolationManager=new Q82.ExtrapolationManager;this._externalDatafeed=a;this._datafeedConfiguration=null;this._callbacks={};this._externalDatafeed.setup({},function(a){b._logMessage("Datafeed settings received: {0}".format(JSON.stringify(a)));b._datafeedConfiguration=b._adoptConfigurationData(a);b._fireEvent("configuration_received")});this._pointsetsManager=new Q81;
|
|
this._rangeExtensionData={summary:0};this._quotesInfo=[];this._endOfData=[];this._extendedRange=function(){return b._rangeExtensionData.summary};PineJSFeed.setupFeed({resolve:function(a,d,e){b.resolveSymbol(a,d,e)},subscribe:function(a,d,e,f,g){var h=a.ticker,k=h+","+d,l=parseInt(e.from/1E3);e=parseInt(e.to/1E3);if(D76.enabled("log_data_request_time")){var m=new Date;console.log(m.toLocaleTimeString()+":"+m.getMilliseconds()+"> Requesting data")}b._logMessage("Requesting data: `{0}` in [{1} ... {2}] ".format(h,
|
|
l,e));b._externalDatafeed.getBars(a,d,l,e,function(e){var g=new PineJS.BarSet(a,e);0<e.length?b._logMessage("Receiving bars: `{0}` total {1} bars in [{2} ... {3}] ".format(h,e.length,e[0].time,e[e.length-1].time)):b._logMessage("Receiving bars: barset is empty");f(g);a.expired||b._externalDatafeed.subscribeBars(a,d,function(a){g.add(a);f(g)},k)},g);return k},unsubscribe:function(a){b._externalDatafeed.unsubscribeBars(a)},calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth,getRangeExtension:this._extendedRange},
|
|
!D76.enabled("disable_resolution_rebuild"))};Q79.prototype.purgeCache=function(){for(var a in this._studiesCache)"series"!=this._studiesCache[a].type&&delete this._studiesCache[a];this._endOfData={};this._symbolInfoCache={}};Q79.prototype._logMessage=function(a){D76.enabled("charting_library_debug_mode")&&console.log(a)};Q79.prototype._extendRange=function(a){this._rangeExtensionData.summary+=a};
|
|
Q79.prototype.on=function(a,b){this._callbacks.hasOwnProperty(a)||(this._callbacks[a]=[]);this._callbacks[a].push(b);return this};Q79.prototype._fireEvent=function(a,b){if(this._callbacks.hasOwnProperty(a)){for(var c=this._callbacks[a],d=0;d<c.length;++d)c[d](b);this._callbacks[a]=[]}};
|
|
Q79.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};Q79.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions};
|
|
Q79.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]};Q79.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]};Q79.prototype._createStudyLogicObject=function(a){var b=a.split("@")[0],c=Q82.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};
|
|
Q79.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,b,c));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)));b=b.map(function(a){a.tickmark=a.time;a.direction=g[a.color];a.onClicked=function(){Z16.emit("onMarkClick",a.id)};a.label=!!a.label&&a.label[0];delete a.color;return a});d(b)},e)}};
|
|
Q79.prototype._computeStudy=function(a,b,c,d,e,f,g,h){var k=!0,l=[],m={},q=0,n=this;this.resolveSymbol(b,function(t){if(PineJS.Symbol.parsePeriod(c).isIntraday&&!t.has_intraday)h("Unsupported resolution");else{var u=new PineJS.StudyEngine({tickerid:b,symbolInfo:t,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,q++);
|
|
"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,t)},recalc:function(){k=!1;f(l,0<q?m:void 0,t)}});n._studiesCache[d].engine=u}},function(a){h(a)})};
|
|
Q79.prototype._createStudy=function(a,b,c,d,e,f,g){var h=this;$.Deferred(function(){ChartapiMessagerInstances[d].onStudyLoading(e,f);h._computeStudy(c,a,b,e,g,function(c,g,m){ChartapiMessagerInstances[d].onDataUpdate(e,f,h._convertBarsTimeToUnix(c),g,m,h._extendedRange(a,b));ChartapiMessagerInstances[d].onStudyCompleted(e,f)},function(c,g,m,q,n){ChartapiMessagerInstances[d].onDataUpdate(e,f,h._convertBarsTimeToUnix(c),q,n,h._extendedRange(a,b))},function(a){ChartapiMessagerInstances[d].onStudyError(e,
|
|
a)})})};Q79.prototype.purgeGuardData=function(a){this._studiesCache[a]&&delete this._studiesCache[a].firstBarTime};
|
|
Q79.prototype.recreateSources=function(a,b,c,d){for(var e in this._studiesCache){var f=this._studiesCache[e];f.engine&&f.engine.stop()}PineJSFeed.unsubscribeUnused();for(e in this._studiesCache)f=this._studiesCache[e],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)};
|
|
Q79.prototype.removeStudy=function(a){this._studiesCache.hasOwnProperty(a)&&this._studiesCache[a].engine&&(this._studiesCache[a].engine.stop(),PineJSFeed.unsubscribeUnused());delete this._studiesCache[a]};Q79.prototype.removeSeries=function(a){this.removeStudy(a)};
|
|
Q79.prototype.recomputeStudy=function(a,b,c,d){var e=this._studiesCache[a];e.inputs=b;e.turnaround=d;e.engine&&e.engine.stop();this._createStudy(e.symbol,e.resolution,e.studyObject,c,a,d,b)};Q79.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};
|
|
Q79.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)};Q79.prototype.purgeRangeExtensionData=function(){this._rangeExtensionData={summary:0}};
|
|
Q79.prototype.extendSeriesRange=function(a,b,c){var d=this._studiesCache[a];if(this._isEndOfData(b,a,d.turnaround)){var e=d.engine.runner.host.symbolInfo.data_status;setTimeout(function(){ChartapiMessagerInstances[b].onSeriesCompleted(a,d.turnaround,e)},0)}else this._extendRange(c+10),this.recreateSources(d.symbol,d.resolution,b,!0)};
|
|
Q79.prototype.updateSeriesTurnaround=function(a,b){this._studiesCache[a]||(this._studiesCache[a]={});this._studiesCache[a].turnaround=b};
|
|
Q79.prototype.createSeries=function(a,b,c,d,e,f){function g(a,d,e){l._extrapolationManager.storage(c,a.full_name,b).setLastBarTime(d,e)}var h=new PineJS.OHLCV,k=this._studiesCache[d];this._studiesCache[d]={symbol:a,resolution:b,studyObject:h,guid:d,type:"series",turnaround:e};ChartapiMessagerInstances[c].onSeriesLoading(d,e);var l=this;this._computeStudy(h,a,b,d,[],function(a,h,n){MarketStatusWatcher.onMainSeriesSymbolChanged(n.session,n.timezone,n.expired);h=l._studiesCache[d];
|
|
var t=l._convertBarsTimeToUnix(a),u=k&&k.firstBarTime,z=0<t.length?1E3*t[0].value[0]:void 0;if(0===t.length||u===z){l._logMessage("Series has no more data on server: {0}".format(n.full_name));l._setEndOfData(c,d,e);if(0===t.length)ChartapiMessagerInstances[c].onSeriesClearData(d,e);ChartapiMessagerInstances[c].onSeriesCompleted(d,e,n.data_status)}else{h.firstBarTime=z;g(n,t.length-1,1E3*t[t.length-1].value[0]);if(f)ChartapiMessagerInstances[c].onSeriesClearData(d,e);ChartapiMessagerInstances[c].onTimescaleUpdate(d,
|
|
e,t,n,0);ChartapiMessagerInstances[c].onSeriesCompleted(d,e,n.data_status);h=l._extrapolationManager.storage(c,n.full_name,b);l._pointsetsManager.broadcastPointsetsUpdates(n.full_name,b,a,h,n,function(a,b){ChartapiMessagerInstances[c].onPointsetDataUpdate(a,e,b,n)})}},function(a,b,f,h,k){var z=l._convertBarsTimeToUnix(a);h=z[z.length-1];b?(b=f-1,l._logMessage("New bar arrived: symbol {0}, bar {1}".format(k.full_name,JSON.stringify(h))),ChartapiMessagerInstances[c].onTimescaleUpdate(d,e,[h],k,b),g(k,
|
|
b,1E3*h.value[0])):(l._logMessage("Last bar update: symbol {0}, bar {1}".format(k.full_name,JSON.stringify(h))),ChartapiMessagerInstances[c].onDataUpdate(d,e,z,void 0,k));l._fireEvent("realtime_tick",a[a.length-1])},function(a){l._logMessage("Series error: {0}".format(a));ChartapiMessagerInstances[c].onSeriesError(d,a)})};Q79.prototype.onMoreTickmarksRequested=function(a,b,c,d,e){this._extrapolationManager.storage(a,c.full_name,d).onTickmarksNeeded(c,e)};
|
|
Q79.prototype.removePointset=function(a){this._pointsetsManager.removePointset(a)};Q79.prototype.rebuildExtrapolatedData=function(a,b,c,d,e){this._extrapolationManager.storage(a,d.full_name,c).rebuild(e,d)};
|
|
Q79.prototype.createPointset=function(a,b,c,d,e,f){var g=this._extrapolationManager.storage(a,d.full_name,e);f=f.slice(0);for(var h=0;h<f.length;++h)f[h][0]=ChartapiMessagerInstances[a].timeInGMT(f[h][0],PineJsCalendar.get_timezone(d.timezone));this._pointsetsManager.createPointset(b,c,e,f,g,d)};Q79.prototype.studiesMetadata=function(){0===this._metainfoCache.length&&(this._metainfoCache=Q82.studyLibrary.map(function(a){return a.metainfo}));return this._metainfoCache};
|
|
Q79.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)})};
|
|
Q79.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))};
|
|
Q79.prototype._stopQuotesSubscription=function(a){this._quotesInfo[a].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[a].listenerGUID),this._quotesInfo[a].listenerGUID=void 0)};
|
|
Q79.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;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)})}};Q79.prototype._restartQuotesSubscription=function(a){this._stopQuotesSubscription(a);this._startQuotesSubscription(a)};Q79.prototype.quoteCreateSession=function(a){this._quotesInfo[a]={symbols:[],fastSymbols:[],listenerGUID:void 0}};Q79.prototype.quoteDeleteSession=function(a){this._stopQuotesSubscription(a);delete this._quotesInfo[a]};
|
|
Q79.prototype.quoteSetFields=function(a,b){};Q79.prototype.quoteAddSymbols=function(a,b){this._quotesInfo[a].symbols=this._filteredSymbols(this._quotesInfo[a].symbols.concat(b));this._restartQuotesSubscription(a)};Q79.prototype.quoteRemoveSymbols=function(a,b){this._quotesInfo[a].symbols=this._quotesInfo[a].symbols.filter(function(a){return 0>b.indexOf(a)});this._restartQuotesSubscription(a)};
|
|
Q79.prototype.quoteFastSymbols=function(a,b){this._quotesInfo[a].fastSymbols=this._filteredSymbols(b);this._restartQuotesSubscription(a)};Q79.prototype._filteredSymbols=function(a){var b=[];a.forEach(function(a){a instanceof Object||0>b.indexOf(a)&&b.push(a)});return b};Q79.prototype._isEndOfData=function(a,b,c){return!!this._endOfData[a+"!"+b+"@"+c]};
|
|
Q79.prototype._setEndOfData=function(a,b,c){this._endOfData[a+"!"+b+"@"+c]=!0};MetainfoTuner=function(){function a(a){D76.enabled("charting_library_debug_mode")&&console.warn("Overrides:"+a)}var b={"volume.volume.transparency":"volume.!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={setProperty:function(d,e){d=b[d]||d;var h=d.split("."),k;a:{k=h[0];for(var l=Q82.studyLibrary,m=0;m<l.length;++m){var q=l[m].metainfo;
|
|
if(q.description.toLowerCase()==k.toLowerCase()||q.shortDescription.toLowerCase()==k.toLowerCase()){k=q;break a}}k=null}if(k)if(0==h[1].indexOf("!"))k[h[1].slice(1)]=e;else{var n;a:{l=k;m=h[1];for(n in l.styles)if(l.styles[n].title.toLowerCase()==m.toLowerCase())break a;n=null}a:{l=k;m=h[1];for(q=0;q<l.inputs.length;++q)if(l.inputs[q].name.toLowerCase()==m.toLowerCase()){l={id:l.inputs[q].id,index:q};break a}l=null}m="options"==h[1];if(n||l||m)if(n&&l||n&&m||l&&m)a("Study `{0}`: ambiguous identifier `{1}`".format(h[0],
|
|
h[1]));else if(n)if(l=e,m=h[2],"color"==m){var t;b:{for(t in k.plots)if("colorer"==k.plots[t].type&&k.plots[t].target==n){t=k.defaults.palettes[k.plots[t].palette];break b}t=null}m=3<h.length?parseInt(h[3]):NaN;null==t&&!isNaN(m)&&0<m?a("Plot `{1}` of `{0}` does not have color #{2}".format(h[0],h[1],m)):0==m||isNaN(m)?(k.defaults.styles[n].color=l,null!=t&&(t.colors[0].color=l)):t.colors[m].color=l}else k.defaults.styles[n].hasOwnProperty(m)?("plottype"==m&&(l=c[l]),k.defaults.styles[n][m]=l):a("Plot `{1}` of `{0}` does not have property `{2}`".format(h[0],
|
|
h[1],m));else l?(h=k,t=l.index,h.defaults.inputs[l.id]=e,h.inputs[t].defval=e):k[h[2]]=e;else a("Study `{0}` has no plot or input `{1}`".format(h[0],h[1]))}else a("Study `{0}` not found".format(h[0]))}};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)Z2.D99.mainSeries().marketStatus.setValue("out_of_session");else{var a=new Date,a=a.valueOf()-60*a.getTimezoneOffset(),b=PineJsCalendar.utc_to_cal(c.timezone,a),a=60*b.getUTCHours()+b.getUTCMinutes(),b=c.spec.findSession(b.getUTCDay()+1,a),a=a>=b.start()&&a<b.start()+b.length()?"market":"out_of_session";Z2.D99.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}();function PublishedChartsTimeline(){}W88=function(){};TradingView.study_PivotPointsStandard=function(){};TradingView.study_PivotPointsHighLow=function(){};TradingView.study_ZigZag=function(){};TradingView.study_LinearRegression=function(){};TradingView.study_ElliottWave=function(){};TradingView.ESDStudyBase=function(){};Q55=function(){this.hasPackage=function(){return!1}};user={is_pro:!1,settings:{}};Q55.prototype.getStudies=function(){return[]};
|
|
Q55.prototype.getProduct=function(){return{}};Q55.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(){};Modernizr.canvas&&Modernizr.canvastext||!window.location.pathname.match(/^\/e\//)||(window.location="/badbrowser/");
|
|
</script><script>(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 domain=document.URL.match(new RegExp("(:?.*://)([^/]+)/.*"))[2];ga("create","UA-53174009-1","auto");ga("set",{hostname:domain,page:domain,referrer:domain});ga("send","pageview");</script><script>urlParams=(function(){var b,e=/\+/g,d=/([^&=]+)=?([^&]*)/g,h=function(i){return decodeURIComponent(i.replace(e," "))},f=window.location.hash.substring(1),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})();var customIndicatorsPresent=!!urlParams.indicatorsFile;var customIndicatorsLodaded=false;var chartApiInitializationTimePassed=false;if(customIndicatorsPresent){$.getScript(urlParams.indicatorsFile).done(function(){if(typeof __customIndicators!="undefined"&&isArray(__customIndicators)){Q82.studyLibrary=Q82.studyLibrary.concat(__customIndicators);console.log("{0} custom indicators loaded.".format(__customIndicators.length));customIndicatorsLodaded=true;if(chartApiInitializationTimePassed){Z15.start()}}}).fail(function(a){console.warn("Error loading custom indicators @ `{0}`: {1} ({2}) ".format(urlParams.indicatorsFile,a.statusText,a.status));customIndicatorsLodaded=true;if(chartApiInitializationTimePassed){Z15.start()}})}pm=TradingView.postMessageWrapper(window.parent);pm.__delayedMesssages=[];pm.on("widgetReady",function(b,a){pm.__delayedMesssages.push({data:b,cb:a})});function postMessageToParent(a,b){if(window&&window.parent){pm.post(window.parent,a,b)}}function customizeUI(a){a.disabledFeatures.map(function(d){D76.setEnabled(d,false)});a.enabledFeatures.map(function(d){D76.setEnabled(d,true)});if(a.studiesOverrides){var c=a.studiesOverrides;for(var b in c){MetainfoTuner.setProperty(b,c[b])}}__defaultsOverrides=a.defaultsOverrides}function createChart(){if(!Modernizr.canvas||!Modernizr.canvastext){throw"Charting library cannot be running under this browser"}D76.setEnabled("charting_library_debug_mode",urlParams.debug=="true");is_authenticated=false;headerChartPanel=$(".header-chart-panel");widgetContainer=$("#library-container");tvHeader=$(".tv-header");footer=$("#footer-chart-panel");customizeUI({studiesOverrides:urlParams.studiesOverrides?JSON.parse(urlParams.studiesOverrides):undefined,disabledFeatures:JSON.parse(urlParams.disabledFeatures),enabledFeatures:JSON.parse(urlParams.enabledFeatures),defaultsOverrides:JSON.parse(urlParams.overrides)});if(D76.enabled("saveload_storage_customization")){if(typeof urlParams.chartsStorageUrl=="undefined"||!urlParams.chartsStorageUrl||typeof urlParams.clientId=="undefined"||!urlParams.clientId){D76.setEnabled("saveload_storage_customization",false);D76.setEnabled("header_saveload",false)}else{ChartsStorage.initialize(urlParams.clientId,urlParams.userId,urlParams.chartsStorageUrl)}}Z15=new Q82.ChartApi(window.parent[urlParams.uid].datafeed);Z15.setTimeFramesList(JSON.parse(urlParams.timeFrames));Z15.setStudiesAccessController(Z15.createStudiesAccessController(urlParams.studiesAccess,urlParams.enabledStudies,urlParams.disabledStudies));if(D76.enabled("narrow_chart_enabled")){$(".chart-page").css("min-width","240px")}if(D76.enabled("use_localstorage_for_settings")){TVSettings.sync()}var g=!!window.parent.__TVSavedChart?window.parent.__TVSavedChart:undefined;delete window.parent.__TVSavedChart;var f={jqParent:$("#chart-area"),onResize:function(l){var k=$(document.body).height()-2;widgetContainer.height(k);var i=D76.enabled("header_widget")?headerChartPanel.outerHeight():0;var j=k-i-tvHeader.outerHeight()-(footer.length?footer.outerHeight():0);j=Math.max(50,j);l.height(j)},padding:D76.enabled("border_around_the_chart")?5:0,edge:D76.enabled("border_around_the_chart")?5:0,content:g?g.json:undefined,widgetOptions:{hideIdeas:true,addVolume:true,handleSessionErrors:true,muteSessionErrors:true,timezone:urlParams.timezone,defSymbol:urlParams.symbol,defInterval:urlParams.interval||"D",hideSymbolSearch:JSON.parse(urlParams.hideSymbolSearch)}};if(g&&typeof g.extendedData!="undefined"){var c=g.extendedData;f.metaInfo={id:c.uid,name:c.name,description:c.description,uid:c.uid,username:"",tags:"",}}Z5=new Q8(f);ChartSaverInstance=saver=new ChartSaver(Z5);Z2=Z5.activeChartWidget.value();pro=new Q55();headerWidget=new Q5({Z5:Z5,headerChartPanel:headerChartPanel,hideStudyTemplates:true});Q45.bindToChartWidgetCollection(Z5);var h=function(){};var e=JSON.parse(urlParams.logo);if(e.image){h=function(){$(".onchart-custom-logo").remove();var i=(/\.png$/.test(e.image))?e.image:e.image+".png";var l=$('<img src="'+i+'">');var m=!e.link?l:$('<a href="'+e.link+'" target="_blank"/>').append(l);var q=$('<span class="text">Powered by <span><a href="https://www.tradingview.com/" target="_blank"><span class="text logo-highlighted">TradingView</span></a>');var k=$('<div class="onchart-custom-logo"/>').appendTo(".chart-widget");var n=$('<div class="wrapper"/>').appendTo(k);var p=$('<table class="inner">').appendTo(n);var o=$("<tr>").appendTo(p);$('<td class="custom-logo">').append(m).appendTo(o);var j=$("<tr>").appendTo(p);$('<td class="tv-link">').append(q).appendTo(j)}}else{h=function(){$(".onchart-tv-logo").remove();var i=$('<div class="onchart-tv-logo wrapper"><div class="wrapper"><a class="inner" href="https://www.tradingview.com/" target="_blank"><img class="solid" src="images/logo-widget-copyright.png" alt="TradingView Logo"><img class="faded" src="images/logo-widget-copyright-faded.png" alt="TradingView Logo"><span class="text">charts by <span class="logo-highlighted">TradingView</span></span></a></div></div>').appendTo(".chart-widget");if(D76.enabled("minimalistic_logo")){i.on("mouseenter",function(){$(this).addClass("expanded")}).on("mouseleave",function(){$(this).removeClass("expanded")})}else{i.addClass("expanded")}}}var a=D76.enabled("widget_logo")&&urlParams.disableLogo!="true";if(a){Z2.withModel(null,h)}TradingView.tokenInitialized.resolve();if(urlParams.toolbarbg){var b="#"+urlParams.toolbarbg;$(".tv-side-toolbar").css("background-color",b);$(".chart-controls-bar").css("background-color",b);$("#chart-area").css("background-color",b);headerChartPanel.css("background-color",b);$("#footer-chart-panel").css("background-color",b)}var d=new Q6({container:$(".tv-side-toolbar"),Z5:Z5,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=d;if(urlParams.hideSideToolbar=="true"||!D76.enabled("left_toolbar")){d._fold(true)}window.lineToolPropertiesToolbar=new TradingView.LineToolPropertiesWidget(Z5);Z2.onDisconnected().subscribe(null,function(i){if(i){showCriticalErrorMessage();return}});$(".tv-content").bind("contextmenu",function(j){var i=$(j.originalEvent.target);if(!i.is("input")&&!i.is("textarea")){return false}});if(customIndicatorsPresent&&!customIndicatorsLodaded){chartApiInitializationTimePassed=true}else{Z15.start()}if(D76.enabled("header_screenshot")){$('<a class="tv-button getimage"><i class="icon"> </i></a>').click(function(i){getImage(Z5,{snapshotUrl:urlParams.snapshotUrl});i.preventDefault()}).appendTo(headerChartPanel.find(".right"))}(function(){pm.on("symbolInfo",function(n,o){var l=Z2.model().mainSeries().symbolInfo(),m=Z2.model().mainSeries().properties().interval.value(),i={name:l.name,exchange:l.exchange,description:l.description,type:l.type,interval:m};o(i)});pm.on("initializationFinished",function(){Q77.clearStack()});function j(l,i){Z2.withModel(null,function(){if(Z2.model().mainSeries().bars().size()>0){i()}else{var m=function(){i();Z2.model().mainSeries().onBarReceived().unsubscribe(null,m)};Z2.model().mainSeries().onBarReceived().subscribe(null,m)}})}pm.on("widgetReady",function(l,i){j(l,i)});for(var k=0;k<pm.__delayedMesssages.length;++k){j(pm.__delayedMesssages[k].data,pm.__delayedMesssages[k].cb)}pm.on("createStudy",function(i){var l=StudyMetaInfo.findStudyMetaInfoByDescription(Z2.model().studiesMetaData(),i.name);var m=Z2.model().insertStudy(l,{},i.forceOverlay);if(!!i.lock&&i.lock){m.setUserEditEnabled(false)}});pm.on("saveChart",function(){var i=ChartSaverInstance.saveToJSON();postMessageToParent("onChartSaved",JSON.parse(i.content))});pm.on("loadChart",function(){var i=window.parent.__TVSavedChart;Z2.loadContent(i.json.charts[0],i.extendedData)});pm.on("changeSymbol",function(l){Q45.interval.setValue(l.interval);Q45.symbol.setValue(l.symbol);function i(){Z2.model().mainSeries().onDataLoaded().unsubscribe(null,i);pm.post(window.parent,"symbolChangeFinished",{})}Z2.model().mainSeries().onDataLoaded().subscribe(null,i)});pm.on("symbolIntervalRequest",function(){pm.post(window.parent,"symbolInterval",JSON.stringify({symbol:Q45.symbol.value(),interval:Q45.interval.value()}))});pm.on("removeIcon",function(i){});pm.on("createShape",function(l){var m=Z2.model().timeScale().timePointToIndex(l.point.time);var t={index:m};if(!!l.point.price){t.price=l.point.price}else{var p=["open","high","low","close"];var n=!!l.point.channel?p.indexOf(l.point.channel)+1:1;if(n<=0){n=1}t.price=Z2.model().mainSeries().data().valueAt(m)[n]}var i=Z2._paneWidgets[0]._state;var r=undefined;var o={arrow_up:{name:"LineToolArrowMarkUp",supportsText:true},arrow_down:{name:"LineToolArrowMarkDown",supportsText:true},flag:{name:"LineToolFlagMark",supportsText:false},vertical_line:{name:"LineToolVertLine",supportsText:false}};var s=o[l.options.shape]||o.flag;if(s.supportsText&&!!l.options.text){r=new W51("linetoolarrowmark");r.text.setValue(l.options.text)}var q=Z2.model().createLineTool(i,t,s.name,r);if(l.options.lock){q.setUserEditEnabled(false)}postMessageToParent("onIconCreated","<icon_uid_here>")})})();Z2.withModel(null,function(){Z2.model().mainSeries().onSymbolResolved().subscribe(null,function(){var j=Z2.model().mainSeries().symbolInfo(),k=Z2.model().mainSeries().properties().interval.value(),i={name:j.name,exchange:j.exchange,description:j.description,type:j.type,interval:k};postMessageToParent("onSymbolChange",i)});Q45.interval.subscribe(function(i){postMessageToParent("onIntervalChange",i)});Z15.on("realtime_tick",function(i){postMessageToParent("onTick",i)});Z15.on("onAutoSaveNeeded",function(){postMessageToParent("onAutoSaveNeeded")});Z16.subscribe("onMarkClick",function(i){postMessageToParent("onMarkClick",i)})})};</script><script>$(window).load(function(){$(window).resize();$(".loading-indicator").hide()});$(function(){var a={lng:urlParams.locale,load:"unspecific",resGetPath:"localization/translations/__lng__.json",keyseparator:"@",nsseparator:"@",fallbackLng:"en"};$.i18n.init(a,function(b){$("html").i18n();createChart();$(window).resize()})});</script></body></html> |