0.7 released
@@ -7,7 +7,7 @@ if (window.TradingView) {
|
||||
var TradingView = {
|
||||
|
||||
version: function() {
|
||||
return 0.6;
|
||||
return "0.7";
|
||||
},
|
||||
|
||||
gEl : function(id) {
|
||||
@@ -80,7 +80,8 @@ var TradingView = {
|
||||
enabledStudies: options.enabled_studies || [],
|
||||
enabledDrawings: options.enabled_drawings || [],
|
||||
disabledDrawings: options.disabled_drawings || [],
|
||||
savedData: options.savedData || undefined
|
||||
savedData: options.savedData || undefined,
|
||||
locale: options.locale
|
||||
};
|
||||
|
||||
if (options.news && options.news.length){
|
||||
@@ -151,6 +152,7 @@ TradingView.widget.prototype = {
|
||||
'&enabledStudies='+ encodeURIComponent(JSON.stringify(this.options.enabledStudies)) +
|
||||
'&enabledDrawings='+ encodeURIComponent(JSON.stringify(this.options.enabledDrawings)) +
|
||||
'&disabledDrawings='+ encodeURIComponent(JSON.stringify(this.options.disabledDrawings)) +
|
||||
'&locale='+ encodeURIComponent(this.options.locale) +
|
||||
(this.options.timezone ? '&timezone='+encodeURIComponent(this.options.timezone) : '');
|
||||
|
||||
if (!!this.options.savedData) {
|
||||
@@ -218,6 +220,10 @@ TradingView.widget.prototype = {
|
||||
widget.parentNode.removeChild(widget);
|
||||
},
|
||||
|
||||
onAutoSaveNeeded : function(callback) {
|
||||
this.postMessage.on('onAutoSaveNeeded', callback);
|
||||
},
|
||||
|
||||
save : function(callback) {
|
||||
this.postMessage.on('onChartSaved', callback);
|
||||
this.postMessage.post(this._messageTarget(), 'saveChart', {});
|
||||
|
||||
@@ -232,7 +232,7 @@ Datafeeds.UDFCompatibleDatafeed.prototype.resolveSymbol = function(symbolName, o
|
||||
Datafeeds.UDFCompatibleDatafeed.prototype.getBars = function(symbolInfo, resolution, rangeStartDate, rangeEndDate, onDataCallback, onErrorCallback) {
|
||||
|
||||
// timestamp sample: 1399939200
|
||||
if ((rangeStartDate + "").length > 10) {
|
||||
if (rangeStartDate > 0 && (rangeStartDate + "").length > 10) {
|
||||
throw "Got a JS time instead of Unix one.";
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ Datafeeds.SymbolsStorage.prototype._onExchangeDataReceived = function(exchangeNa
|
||||
has_no_volume: tableField(data, "has-no-volume", symbolIndex),
|
||||
listed_exchange: listedExchange,
|
||||
exchange: tradedExchange,
|
||||
minmov: tableField(data, "minmovement", symbolIndex),
|
||||
minmov: tableField(data, "minmovement", symbolIndex) || tableField(data, "minmov", symbolIndex) ,
|
||||
pointvalue: tableField(data, "pointvalue", symbolIndex),
|
||||
pricescale: tableField(data, "pricescale", symbolIndex),
|
||||
type: tableField(data, "type", symbolIndex),
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
@import "../../css/mixins/mixins";
|
||||
@import "../../css/basics/basics";
|
||||
|
||||
@import "headerwidget.less";
|
||||
@import "bottomtoolbar.less";
|
||||
@import 'tvscript.less';
|
||||
@import "sidetoolbar.less";
|
||||
@import (less) 'widgetbar.css';
|
||||
@import "wizard.less";
|
||||
@import "linetoolpropertieswidget.less";
|
||||
@import 'minichart.less';
|
||||
@import 'chart_gui.less';
|
||||
@import (less) 'sidebar.css';
|
||||
@import (less) 'watchlist.css';
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
/* Don't forget to invalidate CloudFront cache for '../css/widget.css' via invalidate_cloudfront_widgets.py */
|
||||
|
||||
html, body {background: none; overflow: hidden; min-width: 240px; height: 100%;}
|
||||
|
||||
#widget-container
|
||||
@@ -54,29 +56,48 @@ html, body {background: none; overflow: hidden; min-width: 240px; height: 100%;}
|
||||
.minimized .insert-study-items ul.column { width: 150px; }
|
||||
.minimized .search-header{ display: none; }
|
||||
|
||||
.on-widget .getimage
|
||||
.on-widget .getimage,
|
||||
.on-widget .open-popup
|
||||
{
|
||||
margin-left: 4px;
|
||||
padding: 7px;
|
||||
}
|
||||
|
||||
.on-widget .open-popup {
|
||||
border: none;
|
||||
background: #6798BB;
|
||||
}
|
||||
.on-widget .open-popup:hover { background: #69A3CC; }
|
||||
.on-widget .open-popup:active { background: #71ACD6; }
|
||||
.on-widget .open-popup i {
|
||||
width: 16px;
|
||||
height: 14px;
|
||||
background-image: url("../images/icons.png");
|
||||
background-position: -180px -400px;
|
||||
}
|
||||
|
||||
.on-widget .widgetbar-widget-hotlist .widgetbar-widgetheader .widgetbar-headerspace {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.onchart-tv-logo,
|
||||
.onchart-cme-logo {
|
||||
.onchart-cme-logo,
|
||||
.onchart-custom-logo {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 10px; bottom: 25px;
|
||||
z-index: 10;
|
||||
width: 135px;
|
||||
}
|
||||
|
||||
/* hover state */
|
||||
.onchart-tv-logo {
|
||||
.onchart-cme-logo {
|
||||
left: 10px;
|
||||
bottom: 25px;
|
||||
width: 135px;
|
||||
}
|
||||
.onchart-tv-logo,
|
||||
.onchart-custom-logo {
|
||||
left: 1px;
|
||||
bottom: 22px;
|
||||
width: auto;
|
||||
bottom: 31px;
|
||||
}
|
||||
|
||||
.onchart-tv-logo .wrapper {
|
||||
@@ -85,54 +106,100 @@ html, body {background: none; overflow: hidden; min-width: 240px; height: 100%;}
|
||||
-webkit-border-radius: 3px;
|
||||
-moz-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
-webkit-transition: background 0.6s ease;
|
||||
-moz-transition: width 0.3s ease;
|
||||
-ms-transition: width 0.3s ease;
|
||||
-o-transition: width 0.3s ease;
|
||||
transition: width 0.3s ease;
|
||||
-webkit-transition: background 0.7s ease;
|
||||
-moz-transition: width 0.7s ease;
|
||||
-ms-transition: width 0.7s ease;
|
||||
-o-transition: width 0.7s ease;
|
||||
transition: width 0.7s ease;
|
||||
-webkit-transition: background 0.7s ease;
|
||||
-moz-transition: background 0.7s ease;
|
||||
-ms-transition: background 0.7s ease;
|
||||
-o-transition: background 0.7s ease;
|
||||
transition: background 0.7s ease;
|
||||
}
|
||||
.onchart-tv-logo.expanded .wrapper {
|
||||
background-color: rgba(256, 255, 255, 0.3);
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
.onchart-tv-logo.expanded.grey .wrapper {
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
.onchart-tv-logo.expanded.blue .wrapper {
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.onchart-tv-logo.black .wrapper {
|
||||
background-color: rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
.onchart-tv-logo.expanded.black .wrapper {
|
||||
background-color: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.onchart-tv-logo .inner {
|
||||
display: block;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
line-height: 31px;
|
||||
padding: 0 9px;
|
||||
-webkit-transition: background 0.6s ease;
|
||||
-moz-transition: background 0.6s ease;
|
||||
-ms-transition: background 0.6s ease;
|
||||
-o-transition: background 0.6s ease;
|
||||
transition: background 0.6s ease;
|
||||
-webkit-transition: background 0.7s ease;
|
||||
-moz-transition: background 0.7s ease;
|
||||
-ms-transition: background 0.7s ease;
|
||||
-o-transition: background 0.7s ease;
|
||||
transition: background 0.7s ease;
|
||||
}
|
||||
.onchart-tv-logo.expanded .inner {
|
||||
background-color: rgba(256, 255, 255, 0.8);
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
.onchart-tv-logo.expanded.grey .inner {
|
||||
background-color: rgba(224, 222, 222, 0.8);
|
||||
}
|
||||
.onchart-tv-logo.expanded.blue .inner {
|
||||
background-color: rgba(209, 232, 255, 0.8);
|
||||
}
|
||||
.onchart-tv-logo.expanded.black .inner {
|
||||
background-color: rgba(0, 0, 0, 0.8);
|
||||
}
|
||||
.onchart-tv-logo img {
|
||||
width: 33px;
|
||||
height: 23px;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
-webkit-transition: display 0.7s ease;
|
||||
-moz-transition: display 0.7s ease;
|
||||
-ms-transition: display 0.7s ease;
|
||||
-o-transition: display 0.7s ease;
|
||||
transition: display 0.7s ease;
|
||||
}
|
||||
.onchart-tv-logo .text {
|
||||
display: inline-block;
|
||||
width: 0px;
|
||||
overflow: hidden;
|
||||
padding-left: 4px;
|
||||
/*padding-left: 4px;*/
|
||||
padding-left: 36px;
|
||||
vertical-align: middle;
|
||||
-webkit-transition: width 0.3s ease;
|
||||
-moz-transition: width 0.3s ease;
|
||||
-ms-transition: width 0.3s ease;
|
||||
-o-transition: width 0.3s ease;
|
||||
transition: width 0.3s ease;
|
||||
-webkit-transition: width 0.7s ease;
|
||||
-moz-transition: width 0.7s ease;
|
||||
-ms-transition: width 0.7s ease;
|
||||
-o-transition: width 0.7s ease;
|
||||
transition: width 0.7s ease;
|
||||
}
|
||||
.onchart-tv-logo.expanded .text {
|
||||
width: 145px; /* not 'auto' because of transition */
|
||||
}
|
||||
.onchart-tv-logo img.faded {display: inline-block;}
|
||||
.onchart-tv-logo.expanded img.faded {display: none;}
|
||||
.onchart-tv-logo img.solid {display: none;}
|
||||
.onchart-tv-logo.expanded img.solid {display: inline-block;}
|
||||
.onchart-tv-logo img {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
-webkit-transition: opacity 0.7s ease;
|
||||
-moz-transition: opacity 0.7s ease;
|
||||
-ms-transition: opacity 0.7s ease;
|
||||
-o-transition: opacity 0.7s ease;
|
||||
transition: opacity 0.7s ease;
|
||||
}
|
||||
.onchart-tv-logo img.faded {
|
||||
opacity: 1;
|
||||
}
|
||||
.onchart-tv-logo.expanded img.faded {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.onchart-tv-logo .text .logo-highlighted {
|
||||
font-weight: bold;
|
||||
@@ -220,3 +287,12 @@ html, body {background: none; overflow: hidden; min-width: 240px; height: 100%;}
|
||||
padding: 3px 7px 2px 6px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Custom Logo */
|
||||
.onchart-tv-logo img.custom-image {
|
||||
position: relative;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
BIN
charting_library/static/images/balloon.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 48 KiB |
BIN
charting_library/static/images/prediction-clock-black.png
Normal file
|
After Width: | Height: | Size: 144 B |
BIN
charting_library/static/images/prediction-clock-white.png
Normal file
|
After Width: | Height: | Size: 160 B |
BIN
charting_library/static/images/prediction-failure-white.png
Normal file
|
After Width: | Height: | Size: 125 B |
BIN
charting_library/static/images/prediction-success-white.png
Normal file
|
After Width: | Height: | Size: 168 B |
28
charting_library/static/localization/translations/en.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"__comment": "Tis is css class name. Use `propertypage-name-label-nocap` if each word should not be capitalized. Or use `propertypage-name-label` if should.",
|
||||
"propertypage-name-label_css_class": "propertypage-name-label",
|
||||
|
||||
|
||||
"__comment": "Tis is css class name. This item is not actual for now.",
|
||||
"cursors-group-css-class": "thin",
|
||||
|
||||
"day": "day",
|
||||
"day_plural": "days",
|
||||
|
||||
"week": "week",
|
||||
"week_plural": "weeks",
|
||||
|
||||
"month": "month",
|
||||
"month_plural": "months",
|
||||
|
||||
"minute": "minute",
|
||||
"minute_plural": "minutes",
|
||||
|
||||
"hour": "hour",
|
||||
"hour_plural": "hours",
|
||||
|
||||
"Open_in_legend": "O",
|
||||
"High_in_legend": "H",
|
||||
"Low_in_legend": "L",
|
||||
"Close_in_legend": "C"
|
||||
}
|
||||
568
charting_library/static/localization/translations/ru.json
Normal file
@@ -0,0 +1,568 @@
|
||||
{
|
||||
|
||||
"__comment": "Tis is css class name. Use `propertypage-name-label-nocap` if each word should not be capitalized. Or use `propertypage-name-label` if should.",
|
||||
"propertypage-name-label_css_class": "propertypage-name-label-nocap",
|
||||
|
||||
"Script Editor": "Редактор Pine",
|
||||
" Published Charts Timeline": " опубликованные идеи",
|
||||
"SMA": "SMA",
|
||||
"Bar's Style": "Стиль графика",
|
||||
"Chart Properties": "Свойства графика",
|
||||
"Compare": "Сравнить",
|
||||
"Compare or Add Symbol...": "Сравнить/Добавить инструмент...",
|
||||
"Compare or Add Symbol": "Сравнить/Добавить инструмент",
|
||||
"Add Symbol": "Добавить инструмент",
|
||||
"Scales Properties...": "Свойства шкал...",
|
||||
"Add": "Добавить",
|
||||
"Company Comparison": "Инструмент для сравнения",
|
||||
"Indicators, Fundamentals, Economy and Add-ons": "Индикаторы",
|
||||
"Economy & Symbols": "Сравнить/Добавить инструмент",
|
||||
|
||||
"Bars": "Бары",
|
||||
"Candles": "Японские свечи",
|
||||
"Hollow Candles": "Пустые свечи",
|
||||
"Line": "Линия",
|
||||
"Area": "Зона",
|
||||
"Heiken Ashi": "Хейкин Аши",
|
||||
"Histogram": "Гистограмма",
|
||||
"Cross_chart_type": "Кресты",
|
||||
"Columns": "Столбцы",
|
||||
"Circles": "Точки",
|
||||
|
||||
"Renko": "Renko",
|
||||
"Line Break": "Line Break",
|
||||
"Kagi": "Kagi",
|
||||
"Point & Figure": "Point & Figure",
|
||||
|
||||
|
||||
"Indicators": "Индикаторы",
|
||||
"Favorites": "Предпочтения",
|
||||
"Technical Analysis": "Техничекий анализ",
|
||||
"No indicators matched your criteria.": "Подходящих индикаторов не найдено.",
|
||||
"Add to favorites": "Добавить к предпочтениям",
|
||||
"No symbols matched your criteria": "Подходящих инструментов не найдено",
|
||||
"Company Comparison": "Компания для сравнения",
|
||||
"Add any symbol from the list": "Добавьте любой инструмент из списка",
|
||||
"Overlay the main chart": "Поверх основной серии",
|
||||
"Symbols to be added on the chart": "Выберите любой инструмент из списка",
|
||||
"Symbol": "Инструмент",
|
||||
|
||||
"Default": "Не задано",
|
||||
"Defaults": "По умолчанию",
|
||||
"OK": "Готово",
|
||||
"Cancel": "Отмена",
|
||||
|
||||
" color": " цвет",
|
||||
" transparency": " прозрачность",
|
||||
" visibility": " видимость",
|
||||
"Add To Watchlist": "Добавить к вотч-листу",
|
||||
"Apply": "Применить",
|
||||
"Arguments in Header": "Аргументы в заголовке",
|
||||
"Arrow": "Стрелка",
|
||||
"Auto Scale": "Автоматический масштаб",
|
||||
"Background": "Заливка",
|
||||
"bars": "бары",
|
||||
"bars_margin": "баров",
|
||||
"{0} bars": "Бары: {0}",
|
||||
"Bottom Margin": "Отступ снизу",
|
||||
"Bring Forward": "На один слой вперед",
|
||||
"Bring to Front": "Перенести поверх",
|
||||
"Clone": "Клонировать",
|
||||
"Color Theme": "Цветовая тема",
|
||||
"Copy": "Копировать",
|
||||
"Extended Hours": "Расширенная сессия",
|
||||
"Format...": "Свойства...",
|
||||
"Full Screen": "Во весь экран",
|
||||
"Grid Lines": "Линии сетки",
|
||||
"Hide All Drawing Tools": "Скрыть все фигуры",
|
||||
"Hide": "Скрыть",
|
||||
"Insert Drawing Tool": "Insert Drawing Tool (?)",
|
||||
"Insert Indicator...": "Добавить индикатор...",
|
||||
"Last Value on Price Scale": "Последнее значение на ценовой шкале",
|
||||
"Link To": "Привязать",
|
||||
"Load New Bars": "Load New Bars (?)",
|
||||
"Lock All Drawing Tools": "Зафиксировать все фигуры",
|
||||
"Lock Scale": "Зафиксировать шкалу",
|
||||
"Lock scale": "Зафиксировать шкалу",
|
||||
"Log Scale": "Логирифмическая шкала",
|
||||
"Magnet Mode": "Магнит",
|
||||
"Merge Down": "Присоединить вниз",
|
||||
"Merge Up": "Присоединить вверх",
|
||||
"Objects Tree...": "Дерево объектов...",
|
||||
"Offset": "Смещение",
|
||||
"Override Min Tick": "Минимальное<br/>изменение цены",
|
||||
"Percentage": "Процентое соотношение",
|
||||
"Precision": "Точность",
|
||||
"Price Line": "Линия цены",
|
||||
"Properties...": "Свойства...",
|
||||
"Redo": "Повторить",
|
||||
"Remove All Drawing Tools": "Удалить все фигуры",
|
||||
"Remove All Studies": "Удалить все индикаторы",
|
||||
"Remove All Indicators": "Удалить все индикаторы",
|
||||
"Remove": "Удалить",
|
||||
"Reset Chart": "Сбросить состояние графика",
|
||||
"Reset Scale": "Сбросить состояние шкалы",
|
||||
"Reset": "Сбросить",
|
||||
"Right Margin": "Отступ справа",
|
||||
"Save As...": "Сохранить как...",
|
||||
"Scale Left": "Левая шкала",
|
||||
"Scale Percentage": "Процентная шкала",
|
||||
"Scale Right": "Правая шкала",
|
||||
"Scale Series Only": "Только серии влияют на масштаб",
|
||||
"Scale series only": "Только серии влияют на масштаб",
|
||||
"Scales Lines": "Линии шкал",
|
||||
"Scales Text": "Текст на шкалах",
|
||||
"Scaling": "Привязка к шкале",
|
||||
"Screen (No Scale)": "Экран (нет шкалы)",
|
||||
"Send Backward": "На один слой назад",
|
||||
"Send to Back": "Отправить назад",
|
||||
"Session Breaks": "Границы сессий",
|
||||
"Show Arguments in Header": "Показывать аргументы в заголовке",
|
||||
"Show Last Value on Price Scale": "Показывать последнюю цену на шкале",
|
||||
"Last Value on Price Scale": "Показывать последнюю цену на шкале",
|
||||
"Show Left Axis": "Показать левую шкалу",
|
||||
"Show Right Axis": "Показать правую шкалу",
|
||||
"Show": "Показать",
|
||||
"Stay In Drawing Mode": "Продолжать создание фигур",
|
||||
"Symbol Search...": "Поиск инструментов...",
|
||||
"Change Symbol": "Сменить инструмент",
|
||||
"Change Symbol...": "Сменить инструмент...",
|
||||
"Time Zone": "Часовой пояс",
|
||||
"TimeZone": "Часовой пояс",
|
||||
"Top Margin": "Отступ сверху",
|
||||
"Transparency": "Прозрачность",
|
||||
"Undo {0}": "Отменить {0}",
|
||||
"Undo": "Отменить",
|
||||
"Unmerge Down": "Отсоединить вниз",
|
||||
"Unmerge Up": "Отсоединить наверх",
|
||||
"Visual Order": "Порядок слоёв",
|
||||
"Watermark": "Водяной знак",
|
||||
"Show Objects Tree": "Дерево объектов",
|
||||
|
||||
|
||||
"cursors-group-css-class": "",
|
||||
|
||||
"ABCD Pattern":"Шаблон ABCD",
|
||||
"Anchored Text": "Текст на экране",
|
||||
"Arc": "Дуга",
|
||||
"Arrow Mark Down": "Стрелка вниз",
|
||||
"Arrow Mark Left": "Стрелка влево",
|
||||
"Arrow Mark Right": "Стрелка вправо",
|
||||
"Arrow Mark Up": "Стрелка вверх",
|
||||
"Arrow": "Указатель",
|
||||
"Balloon": "Всплывающий текст",
|
||||
"Bars Pattern": "Шаблон из баров",
|
||||
"Brush": "Кисть",
|
||||
"Callout": "Сноска",
|
||||
"Circle Lines": "Circle Lines (?)",
|
||||
"Cross": "Перекрестие",
|
||||
"Cyclic Lines": "Периодические линии",
|
||||
"Date Range": "Диапазон дат",
|
||||
"Disjoint Angle": "Расходящийся угол",
|
||||
"Dot": "Точка",
|
||||
"Elliott Labels": "Волны Эллиотта",
|
||||
"Elliott Major Retracement": "Основная коррекция Эллиотта",
|
||||
"Elliott Minor Retracement": "Второстепенная коррекция Эллиотта",
|
||||
"Elliott Wave Circle": "Волновой цикл Эллиотта",
|
||||
"Elliott Wave Minor": "Второстепенная волна Эллиотта",
|
||||
"Elliott Wave Subminuette": "Субменуэт волн Элиотта",
|
||||
"Ellipse": "Эллипс",
|
||||
"Eraser": "Ластик",
|
||||
"Extended": "Прямая",
|
||||
"Extended Line": "Прямая",
|
||||
"Fib Channel": "Каналы по Фибоначчи",
|
||||
"Fib Circles": "Окружности по Фибоначчи",
|
||||
"Fib Retracement": "Коррекция по Фибоначчи",
|
||||
"Fib Speed Resistance Arcs": "Дуги сопротивления по Фибоначчи",
|
||||
"Fib Speed Resistance Fan": "Веерные линии сопротивления по Фибоначчи",
|
||||
"Fib Spiral": "Спираль по Фибоначчи",
|
||||
"Fib Time Zone": "Временные периоды по Фибоначчи",
|
||||
"Fib Wedge": "Клин по Фибоначчи",
|
||||
"Flag Mark": "Флаг",
|
||||
"Flat Top/Bottom": "Плоский верх/низ",
|
||||
"Flat Bottom": "Плоский верх/низ",
|
||||
"Forecast": "Предсказание движения",
|
||||
"Gann Box": "Коробка Ганна",
|
||||
"Gann Fan": "Веер Ганна",
|
||||
"Gann Square": "Квадрат Ганна",
|
||||
"Head & Shoulders": "Голова и плечи",
|
||||
"Horizontal Line": "Горизонтальная линия",
|
||||
"Horizontal Ray": "Горизонтальный луч",
|
||||
"Icon": "Значок",
|
||||
"Inside Pitchfork": "Вилы (внутрь)",
|
||||
"Long Position": "Длинная позиция",
|
||||
"Risk/Reward long": "Длинная позиция",
|
||||
"Modified Schiff Pitchfork": "Видоизмененные вилы Шифа",
|
||||
"Parallel Channel": "Канал",
|
||||
"Pitchfan": "Наклонный веер",
|
||||
"Pitchfork": "Вилы",
|
||||
"Polyline": "Ломаная линия",
|
||||
"Price Label": "Отметка на цене",
|
||||
"Price Range": "Диапазон цен",
|
||||
"Projection": "Проекция",
|
||||
"Ray": "Луч",
|
||||
"Rectangle": "Прямоугольник",
|
||||
"Regression Trend": "Направление регрессии",
|
||||
"Rotated Rectangle": "Вращающийся прямоугольник",
|
||||
"Schiff Pitchfork": "Вилы Шифа",
|
||||
"Schiff": "Шифа",
|
||||
"Original": "Обычные",
|
||||
"Modified Schiff": "Измененные Шифа",
|
||||
"Inside": "Внутрь",
|
||||
"Short Position": "Короткая позиция",
|
||||
"Risk/Reward short": "Короткая позиция",
|
||||
"Text": "Текст",
|
||||
"Comment": "Комментарий",
|
||||
"Three Drivers Pattern": "Шаблон трёх движений",
|
||||
"Thumb Down": "Палец вниз",
|
||||
"Thumb Up": "Палец вверх",
|
||||
"Trend Angle": "Угол тренда",
|
||||
"Trend Line": "Линия тренда",
|
||||
|
||||
"Trend-Based Fib Extension": "Расширение Фибоначчи, основанное на тренде",
|
||||
"Trend-Based Fib Time": "Периоды Фибоначчи, основанные на тренде",
|
||||
|
||||
"Triangle Pattern": "Шаблон \"Треугольник\"",
|
||||
"Triangle": "Треугольник",
|
||||
"Vertical Line": "Вертикальная линия",
|
||||
"XABCD Pattern": "Шаблон XABCD",
|
||||
|
||||
|
||||
"Angle:": "Угол:",
|
||||
"Arcs": "Дуги",
|
||||
"Background color 1": "Цвет подложки №1",
|
||||
"Background color 2": "Цвет подложки №2",
|
||||
"Background Color": "Цвет подложки",
|
||||
"Bar #": "№ бара",
|
||||
"Border color": "Цвет обводки",
|
||||
"Border Color": "Цвет обводки",
|
||||
"Border": "Граница",
|
||||
"Bottom Lables": "Текст снизу",
|
||||
"bottom": "снизу",
|
||||
"center": "по центру",
|
||||
"Channel": "Канал",
|
||||
"Coeffs As Percents": "Коэффициенты в процентах",
|
||||
"Color bars based on previous close": "Цвет основан на предыдущем баре",
|
||||
"Color": "Цвет",
|
||||
"Color:": "Цвет:",
|
||||
"Source_compare": "Источник данных",
|
||||
"Coordinates": "Координаты",
|
||||
"Delete": "Удалить",
|
||||
"Down Color": "Цвет падающего бара",
|
||||
"Drawings": "Фигуры",
|
||||
"Entry price:": "Открытия позиции:",
|
||||
"Events": "События",
|
||||
"Extend Left End": "Продолжить влево",
|
||||
"Extend Left": "Продолжить влево",
|
||||
"Extend Lines": "Продолжить линии",
|
||||
"Extend Right End": "Продолжить вправо",
|
||||
"Extend Right": "Продолжить вправо",
|
||||
"Extend": "Продолжить",
|
||||
"Failure back color": "Заливка (неудача)",
|
||||
"Failure text color": "Текст (неудача)",
|
||||
"Fans": "Линии",
|
||||
"Fill": "Заливка",
|
||||
"Format": "Формат",
|
||||
"Graphics": "Графики (?)",
|
||||
"Grid": "Сетка",
|
||||
"Help": "Справка",
|
||||
"HLC Bars": "Скрыть цену открытия",
|
||||
"Inputs": "Аргументы",
|
||||
"Label Background": "Заливка текстовой метки",
|
||||
"Label": "Метка",
|
||||
"Labels": "Метки",
|
||||
"Left End": "Левый край",
|
||||
"Left Labels": "Текст слева",
|
||||
"left": "слева",
|
||||
"Level {0}": "Уровень {0}",
|
||||
"Levels": "Уровни",
|
||||
"Line": "Линия",
|
||||
"Lines": "Линии",
|
||||
"Major": "Основная",
|
||||
"Measure (Shift + Click on the chart)": "Измерение (Shift + клик на чарте)",
|
||||
"Median": "Средняя линия",
|
||||
"middle": "по центру",
|
||||
"Middle": "Средняя линия",
|
||||
"Minor": "Побочная",
|
||||
"Mode": "Режим",
|
||||
"Normal": "Обычный",
|
||||
"Plot": "Линия",
|
||||
"Price Levels": "Уровни цены",
|
||||
"Price Source": "Ценовая серия",
|
||||
"Price": "Цена",
|
||||
"Price:": "Цена:",
|
||||
"Prices": "Цены",
|
||||
"Profit Background Color": "Profit Background Color (?)",
|
||||
"Profit Level. Ticks:": "Цель. Тики:",
|
||||
"Properties": "Свойства",
|
||||
"Reverse": "Инвертировать",
|
||||
"Right End": "Правый край",
|
||||
"Right Lables": "Текст справа",
|
||||
"right": "справа",
|
||||
"Log Scale_scale_menu": "Логарифмическая шкала",
|
||||
"Percentage_scale_menu": "Процентная шкала",
|
||||
"Scales": "Шкалы",
|
||||
"Settings": "Настройки",
|
||||
"Show Background": "Отображать подложку",
|
||||
"Show Bars Range": "Отображать диапазон в барах",
|
||||
"Show Date/Time Range": "Отображать временной диапазон",
|
||||
"Show Distance": "Отображать расстояние",
|
||||
"Show Labels": "Отображать текстовые метки",
|
||||
"Show Price Range": "Отображать диапазон цен",
|
||||
"Show Price": "Отображать цену",
|
||||
"Show Prices": "Отображать цены",
|
||||
"Show Text": "Отображать текст",
|
||||
"Show Time": "Отображать время",
|
||||
"Show Wave": "Отображать волну",
|
||||
"Show/Hide": "Показать/Скрыть",
|
||||
"Source back color": "Заливка (открытие)",
|
||||
"Source border color": "Граница (открытие)",
|
||||
"Source text color": "Текст (открытие)",
|
||||
"Stay in Drawing Mode": "Не выходить из режима рисования",
|
||||
"Stop Background Color": "Stop Background Color (?)",
|
||||
"Stop Color:": "Цвет стоп-уровня:",
|
||||
"Stop Level. Ticks:": "Стоп-уровень. Тики:",
|
||||
"Style": "Стиль",
|
||||
"Success back color": "Заливка (успех)",
|
||||
"Success text color": "Текст (успех)",
|
||||
"Target back color": "Заливка (цель)",
|
||||
"Target border color": "Граница (цель)",
|
||||
"Target Color:": "Цвет цели:",
|
||||
"Target text color": "Текст (цель)",
|
||||
"Text Alignment:": "Выравнивание текста:",
|
||||
"Text color": "Цвет текста",
|
||||
"Text Color": "Цвет текста",
|
||||
"Text Font": "Шрифт",
|
||||
"Text Wrap": "Перенос строк",
|
||||
"Text": "Текст",
|
||||
"Text:": "Текст:",
|
||||
"Time Levels": "Уровни времени",
|
||||
"Timezone/Sessions": "Часовой пояс и сессии",
|
||||
"Top Labels": "Текст сверху",
|
||||
"top": "сверху",
|
||||
"Up Color": "Цвет растущего бара",
|
||||
"Wave Size": "Размер волны",
|
||||
"Wick": "Фитиль",
|
||||
"Zoom In": "Увеличить масштаб",
|
||||
"Zoom Out": "Уменьшить масштаб",
|
||||
"Borders": "Обводка",
|
||||
"Level": "Уровень",
|
||||
"Hlines Background": "Заливка",
|
||||
"Plots Background": "Заливка",
|
||||
|
||||
"Open_line_tool_position": "Открыта",
|
||||
"Closed_line_tool_position": "Закрыта",
|
||||
"{0} P&L: {1}": "{0} П(У): {1}",
|
||||
"Risk/Reward Ratio: {0}": "Соотношение риск/премия: {0}",
|
||||
"Stop: {0} ({1}%)": "Стоп-уровень: {0} ({1}%)",
|
||||
"Target: {0} ({1}%)": "Цель: {0} ({1}%)",
|
||||
"SUCCESS": "УСПЕХ",
|
||||
"FAILURE": "НЕУДАЧА",
|
||||
"Left Shoulder": "Левое плечо",
|
||||
"Head": "Голова",
|
||||
"Right Shoulder": "Правое плечо",
|
||||
"Mirrored": "Отобразить по вертикали",
|
||||
"Flipped": "Отразить по горизонтали",
|
||||
"distance: {0}": "Расстояние: {0}",
|
||||
|
||||
"day": "день",
|
||||
"day_plural_1": "день",
|
||||
"day_plural_2": "дня",
|
||||
"day_plural_5": "дней",
|
||||
|
||||
"week": "неделя",
|
||||
"week_plural_1": "неделя",
|
||||
"week_plural_2": "недели",
|
||||
"week_plural_5": "недель",
|
||||
|
||||
"month": "месяц",
|
||||
"month_plural_1": "месяц",
|
||||
"month_plural_2": "месяца",
|
||||
"month_plural_5": "месяцев",
|
||||
|
||||
"minute": "минута",
|
||||
"minute_plural_1": "минута",
|
||||
"minute_plural_2": "минуты",
|
||||
"minute_plural_5": "минут",
|
||||
|
||||
"hour": "час",
|
||||
"hour_plural_1": "час",
|
||||
"hour_plural_2": "часа",
|
||||
"hour_plural_5": "часов",
|
||||
|
||||
"d_dates": "д.",
|
||||
"h_dates": "ч.",
|
||||
"m_dates": "мин.",
|
||||
"s_dates": "с.",
|
||||
"in_dates": "за",
|
||||
|
||||
|
||||
"Jan": "Янв",
|
||||
"Feb": "Фев",
|
||||
"Mar": "Мар",
|
||||
"Apr": "Апр",
|
||||
"May": "Май",
|
||||
"Jun": "Июн",
|
||||
"Jul": "Июл",
|
||||
"Aug": "Авг",
|
||||
"Sep": "Сен",
|
||||
"Oct": "Окт",
|
||||
"Nov": "Ноя",
|
||||
"Dec": "Дек",
|
||||
|
||||
|
||||
"Objects Tree": "Все объекты",
|
||||
"Manage Drawings": "Фигуры",
|
||||
"TOOL": "Фигура",
|
||||
"SYMBOL": "Инструмент",
|
||||
"Move Up": "Переместить вверх",
|
||||
"Move Down": "Переместить вниз",
|
||||
|
||||
|
||||
"All Exchanges": "Все биржи",
|
||||
"All types": "Все типы",
|
||||
"Stock": "Акции",
|
||||
"stock": "акция",
|
||||
"Index": "Индексы",
|
||||
"index": "индекс",
|
||||
"Futures": "Фьючерсы",
|
||||
"futures": "фьючерс",
|
||||
|
||||
|
||||
"Image URL": "Изображение",
|
||||
"Save image": "Сохраните изображение",
|
||||
"or copy url:": "или скопируйте его адрес:",
|
||||
|
||||
"Undo {0}": "Отменить",
|
||||
"Redo {0}": "Повторить",
|
||||
|
||||
"Custom color...": "Выбрать цвет...",
|
||||
"Search": "Поиск",
|
||||
|
||||
"Open_in_legend": "ОТКР",
|
||||
"High_in_legend": "МАКС",
|
||||
"Low_in_legend": "МИН",
|
||||
"Close_in_legend": "ЗАКР",
|
||||
|
||||
"Open": "Открытие",
|
||||
"High": "Максимум",
|
||||
"Low": "Минимум",
|
||||
"Close": "Закрытие",
|
||||
"(H + L)/2": "(МИН+МАКС)/2",
|
||||
"(H + L + C)/3": "(МИН+МАКС+ЗАКР)/3",
|
||||
"(O + H + L + C)/4": "(МИН+МАКС+ЗАКР+ОТКР)/4",
|
||||
|
||||
|
||||
"UTC": "По Гринвичу",
|
||||
"Exchange": "По бирже",
|
||||
"Athens": "Афины",
|
||||
"Berlin": "Берлин",
|
||||
"Bogota": "Богота",
|
||||
"Buenos Aires": "Буэнос-Айрес",
|
||||
"Chicago": "Чикаго",
|
||||
"Hong Kong": "Гонконг",
|
||||
"Kolkata": "Калькутта",
|
||||
"London": "Лондон",
|
||||
"Los Angeles": "Лос-Анджелес",
|
||||
"Madrid": "Мадрид",
|
||||
"Moscow": "Москва",
|
||||
"New York": "Нью-Йорк",
|
||||
"Paris": "Париж",
|
||||
"Seoul": "Сеул",
|
||||
"Shanghai": "Шанхай",
|
||||
"Singapore": "Сингапур",
|
||||
"Sydney": "Сидней",
|
||||
"Taipei": "Тайбей",
|
||||
"Tokyo": "Токио",
|
||||
"Toronto": "Торонто",
|
||||
"Vancouver": "Ванкувер",
|
||||
"Warsaw": "Варшава",
|
||||
|
||||
"n/a": "н/д",
|
||||
|
||||
"Long_input": "Длинный период",
|
||||
"long_input": "Длинный период",
|
||||
"longlen_input": "Длинный период",
|
||||
"Window Size_input": "Размер окна",
|
||||
"Length_input": "Размер окна",
|
||||
"length_input": "Размер окна",
|
||||
"len_input": "Размер окна",
|
||||
"Short_input": "Короткий период",
|
||||
"short_input": "Короткий период",
|
||||
"shortlen_input": "Короткий период",
|
||||
"Mult_input": "Множитель",
|
||||
"mult_input": "Множитель",
|
||||
"divisor_input": "Делитель",
|
||||
"Divisor_input": "Делитель",
|
||||
"Upper": "Верхняя линия",
|
||||
"Lower": "Нижняя линия",
|
||||
"Long": "Длинная линия",
|
||||
"Short": "Короткая линия",
|
||||
"Signal": "Сигнал",
|
||||
"Jaw": "Челюсти",
|
||||
"Teeth": "Зубы",
|
||||
"Lips": "Губы",
|
||||
"Zero": "Ноль",
|
||||
"WMA Length_input": "Длина WMA",
|
||||
"Long RoC Length_input": "Длинный сигнал RoC",
|
||||
"Short RoC Length_input": "Короткий сигнал RoC",
|
||||
"jawLength_input": "Длина челюстей",
|
||||
"teethLength_input": "Длина зубов",
|
||||
"lipsLength_input": "Длина губ",
|
||||
"percent_input": "Процент",
|
||||
"exponential_input": "Использовать эксп. среднее",
|
||||
"smoothD_input": "Сглаживание %D",
|
||||
"smoothK_input": "Сглаживание %K",
|
||||
"Color 0": "Цвет 0",
|
||||
"Color 1": "Цвет 1",
|
||||
"Color 2": "Цвет 2",
|
||||
"Color 3": "Цвет 3",
|
||||
"Color 4": "Цвет 4",
|
||||
"sym_input": "Инструмент",
|
||||
"symbol_input": "Инструмент",
|
||||
"Sym_input": "Инструмент",
|
||||
"DI Length_input": "Длина DI",
|
||||
"ADX Smoothing_input": "Сглаживание ADX",
|
||||
"displacement_input": "Смещение",
|
||||
|
||||
"Tenkan-sen": "Tenkan-sen",
|
||||
"Kijun-sen": "Kijun-sen",
|
||||
"Chikou span": "Chikou span",
|
||||
"Senkou A": "Senkou A",
|
||||
"Senkou B": "Senkou B",
|
||||
|
||||
"useTrueRange_input": "Использовать TrueRange",
|
||||
"roclen1_input": "Длина RoC 1",
|
||||
"roclen2_input": "Длина RoC 2",
|
||||
"roclen3_input": "Длина RoC 3",
|
||||
"roclen4_input": "Длина RoC 4",
|
||||
"smalen1_input": "Длина MA 1",
|
||||
"smalen2_input": "Длина MA 2",
|
||||
"smalen3_input": "Длина MA 3",
|
||||
"smalen4_input": "Длина MA 4",
|
||||
"siglen_input": "Длина сигнала",
|
||||
|
||||
"UpperLimit": "Верхняя граница",
|
||||
"LowerLimit": "Нижняя граница",
|
||||
|
||||
"fastLength_input": "Длина быстрой линии",
|
||||
"slowLength_input": "Длина медленной линии",
|
||||
"signalLength_input": "Длина сигнальной линии",
|
||||
|
||||
"start_input": "Начальное значение",
|
||||
"increment_input": "Приращение",
|
||||
"maximum_input": "Максимум",
|
||||
"showMA_input": "Отображать среднее",
|
||||
"Volume": "Объём",
|
||||
"Volume MA": "Средняя по объёму",
|
||||
"Indicator": "Индикатор",
|
||||
"Oscillator": "Осциллятор",
|
||||
"lengthStoch_input": "Длина Stochastic",
|
||||
"lengthRSI_input": "Длина RSI",
|
||||
|
||||
"sigma_input": "Сигма",
|
||||
"Sigma_input": "Сигма",
|
||||
|
||||
"Crosses": "Пересечение"
|
||||
|
||||
}
|
||||
@@ -2,21 +2,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>TradingView Chart Widget</title>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=100" />
|
||||
|
||||
<link href="css/site.compiled.css" rel="stylesheet" type="text/css" />
|
||||
<link href="chart-client/css/chartclient.compiled.css" rel="stylesheet" type="text/css" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="css/widget.css" />
|
||||
|
||||
</head>
|
||||
<body class="chart-page on-widget">
|
||||
<div class="loading-indicator">
|
||||
<img src="images/loading.gif" alt=""/>
|
||||
</div>
|
||||
<div id="widget-container" class="chart-page">
|
||||
<div id="library-container" class="chart-page">
|
||||
<div class="tv-side-toolbar"></div>
|
||||
<div class="tv-side-panel"></div>
|
||||
<div class="tv-main-panel">
|
||||
@@ -36,176 +33,270 @@
|
||||
<script type="text/javascript" src="tv-chart.min.js"></script>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
if (!Modernizr.canvas || !Modernizr.canvastext) {
|
||||
function createChart() {
|
||||
|
||||
// TODO: emit an error message
|
||||
window.location = '/badbrowser/';
|
||||
}
|
||||
if (!Modernizr.canvas || !Modernizr.canvastext) {
|
||||
|
||||
var
|
||||
is_authenticated = false,
|
||||
// TODO: emit an error message
|
||||
window.location = '/badbrowser/';
|
||||
}
|
||||
|
||||
urlParams = (function () {
|
||||
var match,
|
||||
pl = /\+/g, // Regex for replacing addition symbol with a space
|
||||
search = /([^&=]+)=?([^&]*)/g,
|
||||
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
|
||||
query = window.location.search.substring(1),
|
||||
result = {};
|
||||
is_authenticated = false;
|
||||
|
||||
while (match = search.exec(query)) {
|
||||
result[decode(match[1])] = decode(match[2]);
|
||||
headerChartPanel = $('.header-chart-panel');
|
||||
widgetContainer = $('#library-container');
|
||||
tvHeader = $(".tv-header");
|
||||
footer = $("#footer-chart-panel");
|
||||
|
||||
|
||||
ChartApiInstance = new JSServer.ChartApi();
|
||||
|
||||
if (urlParams.enabledStudies) {
|
||||
ChartApiInstance.setEnabledStudiesList(JSON.parse(urlParams.enabledStudies));
|
||||
}
|
||||
|
||||
|
||||
var savedContent = !!window.parent.__TVSavedChart
|
||||
? window.parent.__TVSavedChart
|
||||
: undefined;
|
||||
|
||||
delete window.parent.__TVSavedChart;
|
||||
|
||||
|
||||
chartWidgetCollection = new TradingView.ChartWidgetCollection({
|
||||
jqParent: $('#chart-area'),
|
||||
onResize: function ($container){
|
||||
var containerHeight = $(document.body).height() - 2;
|
||||
widgetContainer.height(containerHeight);
|
||||
var h = containerHeight - headerChartPanel.outerHeight() - tvHeader.outerHeight() - (footer.length ? footer.outerHeight() : 0);
|
||||
h = Math.max(50, h);
|
||||
$container.height(h);
|
||||
},
|
||||
padding: 5,
|
||||
edge: 5,
|
||||
content: savedContent,
|
||||
widgetOptions: {
|
||||
hideIdeas: true,
|
||||
controlBar: true,
|
||||
addVolume: true,
|
||||
handleSessionErrors: false,
|
||||
muteSessionErrors: true,
|
||||
timezone: urlParams.timezone,
|
||||
defSymbol: urlParams.symbol || 'MSF',
|
||||
defInterval: urlParams.interval || 'D'
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
});
|
||||
|
||||
|
||||
var headerChartPanel = $('.header-chart-panel');
|
||||
var widgetContainer = $('#widget-container');
|
||||
var tvHeader = $(".tv-header");
|
||||
var footer = $("#footer-chart-panel");
|
||||
chartWidget = chartWidgetCollection.activeChartWidget.value();
|
||||
pro = new TradingView.Pro();
|
||||
|
||||
headerWidget = new TradingView.ChartHeaderWidgetRestricted({
|
||||
chartWidgetCollection: chartWidgetCollection,
|
||||
headerChartPanel: headerChartPanel,
|
||||
hideStudyTemplates: true,
|
||||
});
|
||||
|
||||
TradingView.Linking.bindToChartWidgetCollection(chartWidgetCollection);
|
||||
|
||||
|
||||
var ChartApiInstance = new JSServer.ChartApi();
|
||||
chartWidget.withModel(null, function () {
|
||||
(function createLogo() {
|
||||
$('.onchart-tv-logo').remove();
|
||||
$('.tv-main-panel').append(
|
||||
'<div class="onchart-tv-logo wrapper">'+
|
||||
'<div class="wrapper">'+
|
||||
'<a class="inner" href="https://www.tradingview.com/" target="_blank">'+
|
||||
|
||||
if (urlParams.enabledStudies) {
|
||||
ChartApiInstance.setEnabledStudiesList(JSON.parse(urlParams.enabledStudies));
|
||||
}
|
||||
|
||||
'<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>'
|
||||
);
|
||||
})();
|
||||
|
||||
});
|
||||
|
||||
TradingView.tokenInitialized.resolve();
|
||||
|
||||
window.studyTemplates = new TradingView.StudyTemplates({chartWidgetCollection: chartWidgetCollection});
|
||||
ChartApiInstance.start();
|
||||
|
||||
headerChartPanel.css('background-color', '#'+(urlParams.toolbarbg || 'F1F3F6'));
|
||||
$("#footer-chart-panel").css('background-color', '#'+(urlParams.toolbarbg || 'F1F3F6'));
|
||||
|
||||
|
||||
var savedContent = !!window.parent.__TVSavedChart
|
||||
? window.parent.__TVSavedChart
|
||||
: undefined;
|
||||
sidetoolbar = new TradingView.ChartSideToolbarWidget({
|
||||
container: $('.tv-side-toolbar'),
|
||||
chartWidgetCollection: chartWidgetCollection,
|
||||
onWidget: true,
|
||||
enabledDrawings: urlParams.enabledDrawings ? JSON.parse(urlParams.enabledDrawings ) : [],
|
||||
disabledDrawings: urlParams.disabledDrawings ? JSON.parse(urlParams.disabledDrawings ) : []
|
||||
});
|
||||
|
||||
delete window.parent.__TVSavedChart;
|
||||
window.lineToolPropertiesToolbar = new TradingView.LineToolPropertiesWidget(chartWidgetCollection);
|
||||
$('.tv-main-panel').css('margin-left', sidetoolbar.element().width() + 'px');
|
||||
|
||||
chartWidget.onDisconnected().subscribe(null, function(critical_error) {
|
||||
if (critical_error) {
|
||||
showCriticalErrorMessage();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
$('.tv-content').bind('contextmenu', function(e) {
|
||||
var $originalTarget = $(e.originalEvent.target);
|
||||
if (!$originalTarget.is('input') && !$originalTarget.is('textarea')) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
chartWidgetCollection = new TradingView.ChartWidgetCollection({
|
||||
jqParent: $('#chart-area'),
|
||||
onResize: function ($container){
|
||||
var containerHeight = $(document.body).height() - 2;
|
||||
widgetContainer.height(containerHeight);
|
||||
var h = containerHeight - headerChartPanel.outerHeight() - tvHeader.outerHeight() - (footer.length ? footer.outerHeight() : 0);
|
||||
h = Math.max(50, h);
|
||||
$container.height(h);
|
||||
},
|
||||
padding: 5,
|
||||
edge: 5,
|
||||
content: savedContent,
|
||||
widgetOptions: {
|
||||
hideIdeas: true,
|
||||
controlBar: true,
|
||||
addVolume: true,
|
||||
handleSessionErrors: false,
|
||||
muteSessionErrors: true,
|
||||
timezone: urlParams.timezone,
|
||||
//containsData: !!savedContent,
|
||||
|
||||
defSymbol: urlParams.symbol || 'MSF',
|
||||
defInterval: urlParams.interval || 'D'
|
||||
if (!urlParams.saveimage) {
|
||||
$('<a class="tv-button getimage"><i class="icon"> </i></a>')
|
||||
.click(function(e){
|
||||
getImage(chartWidgetCollection);
|
||||
e.preventDefault();
|
||||
})
|
||||
.appendTo(headerChartPanel.find('.right'));
|
||||
}
|
||||
});
|
||||
|
||||
ChartSaverInstance = new ChartSaver(chartWidgetCollection);
|
||||
|
||||
pm = TradingView.postMessageWrapper(window.parent);
|
||||
|
||||
(function() {
|
||||
|
||||
pm.on('symbolInfo', function (data, callback) {
|
||||
var symbolInfo = chartWidget.model().mainSeries().symbolInfo(),
|
||||
interval = chartWidget.model().mainSeries().properties().interval.value(),
|
||||
result = {
|
||||
name: symbolInfo.name,
|
||||
exchange: symbolInfo.exchange,
|
||||
description: symbolInfo.description,
|
||||
type: symbolInfo.type,
|
||||
interval: interval
|
||||
};
|
||||
callback(result);
|
||||
});
|
||||
|
||||
|
||||
var chartWidget = chartWidgetCollection.activeChartWidget.value();
|
||||
var pro = new TradingView.Pro();
|
||||
|
||||
headerWidget = new TradingView.ChartHeaderWidgetRestricted({
|
||||
chartWidgetCollection: chartWidgetCollection,
|
||||
headerChartPanel: headerChartPanel,
|
||||
hideStudyTemplates: true,
|
||||
});
|
||||
|
||||
TradingView.Linking.bindToChartWidgetCollection(chartWidgetCollection);
|
||||
pm.on('initializationFinished', function() {
|
||||
TradingView.UndoHistory.clearStack();
|
||||
});
|
||||
|
||||
|
||||
chartWidget.withModel(null, function () {
|
||||
(function createLogo() {
|
||||
$('.onchart-tv-logo').remove();
|
||||
$('.tv-main-panel').append(
|
||||
'<div class="onchart-tv-logo wrapper">'+
|
||||
'<div class="wrapper">'+
|
||||
'<a class="inner" href="https://www.tradingview.com/" target="_blank">'+
|
||||
pm.on('widgetReady', function(data, cb) {
|
||||
chartWidget.withModel(null, function () {
|
||||
if (chartWidget.model().mainSeries().bars().size() > 0) {
|
||||
cb();
|
||||
} else {
|
||||
var eventHandler = function() {
|
||||
cb();
|
||||
chartWidget.model().mainSeries().onBarReceived().unsubscribe(null, eventHandler);
|
||||
};
|
||||
chartWidget.model().mainSeries().onBarReceived().subscribe(null, eventHandler);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
pm.on('createStudy', function(options) {
|
||||
var metainfo = StudyMetaInfo.findStudyMetaInfoByDescription(chartWidget.model().studiesMetaData(), options.name);
|
||||
var study = chartWidget.model().insertStudy(metainfo, {}, false);
|
||||
|
||||
if (!!options.lock && options.lock) {
|
||||
study.setUserEditEnabled(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
'<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">'+
|
||||
pm.on('loadChart', function(content) {
|
||||
reloadChart(content);
|
||||
});
|
||||
|
||||
|
||||
'<span class="text">'+
|
||||
'charts by '+
|
||||
'<span class="logo-highlighted">TradingView</span>'+
|
||||
'</span>'+
|
||||
'</a>'+
|
||||
'</div>'+
|
||||
'</div>'
|
||||
);
|
||||
})();
|
||||
|
||||
});
|
||||
|
||||
TradingView.tokenInitialized.resolve();
|
||||
|
||||
window.studyTemplates = new TradingView.StudyTemplates({chartWidgetCollection: chartWidgetCollection});
|
||||
ChartApiInstance.start();
|
||||
|
||||
headerChartPanel.css('background-color', '#'+(urlParams.toolbarbg || 'F1F3F6'));
|
||||
$("#footer-chart-panel").css('background-color', '#'+(urlParams.toolbarbg || 'F1F3F6'));
|
||||
pm.on('saveChart', function() {
|
||||
var savedData = ChartSaverInstance.saveToJSON();
|
||||
pm.post(window.parent, 'onChartSaved', JSON.parse(savedData.content));
|
||||
});
|
||||
|
||||
|
||||
sidetoolbar = new TradingView.ChartSideToolbarWidget({
|
||||
container: $('.tv-side-toolbar'),
|
||||
chartWidgetCollection: chartWidgetCollection,
|
||||
onWidget: true,
|
||||
enabledDrawings: urlParams.enabledDrawings ? JSON.parse(urlParams.enabledDrawings ) : [],
|
||||
disabledDrawings: urlParams.disabledDrawings ? JSON.parse(urlParams.disabledDrawings ) : []
|
||||
});
|
||||
|
||||
window.lineToolPropertiesToolbar = new TradingView.LineToolPropertiesWidget(chartWidgetCollection);
|
||||
$('.tv-main-panel').css('margin-left', sidetoolbar.element().width() + 'px');
|
||||
|
||||
chartWidget.onDisconnected().subscribe(null, function(critical_error) {
|
||||
if (critical_error) {
|
||||
showCriticalErrorMessage();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
$('.tv-content').bind('contextmenu', function(e) {
|
||||
var $originalTarget = $(e.originalEvent.target);
|
||||
if (!$originalTarget.is('input') && !$originalTarget.is('textarea')) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
pm.on('changeSymbol', function(data) {
|
||||
TradingView.Linking.symbol.setValue(data.symbol);
|
||||
TradingView.Linking.interval.setValue(data.interval);
|
||||
});
|
||||
|
||||
|
||||
if (!urlParams.saveimage) {
|
||||
$('<a class="tv-button getimage"><i class="icon"> </i></a>')
|
||||
.click(function(e){
|
||||
getImage(chartWidgetCollection);
|
||||
e.preventDefault();
|
||||
})
|
||||
.appendTo(headerChartPanel.find('.right'));
|
||||
}
|
||||
pm.on('removeIcon', function(iconUID) {
|
||||
;
|
||||
});
|
||||
|
||||
$(window).resize();
|
||||
pm.on('createShape', function(data) {
|
||||
var barIndex = chartWidget.model().timeScale().timePointToIndex(data.point.time)
|
||||
var point = { index: barIndex };
|
||||
|
||||
$(window).load(function(){
|
||||
$(window).resize();
|
||||
$('.loading-indicator').hide();
|
||||
});
|
||||
if (!!data.point.price) {
|
||||
point.price = data.point.price;
|
||||
}
|
||||
else {
|
||||
var indexes = ['open', 'high', 'low', 'close'];
|
||||
|
||||
var indexOffset = !!data.point.channel
|
||||
? indexes.indexOf(data.point.channel) + 1
|
||||
: 1;
|
||||
|
||||
if (indexOffset <= 0) {
|
||||
indexOffset = 1;
|
||||
}
|
||||
|
||||
point.price = chartWidget.model().mainSeries().data().valueAt(barIndex)[indexOffset];
|
||||
}
|
||||
|
||||
var pane = chartWidget._paneWidgets[0]._state;
|
||||
var properties = undefined;
|
||||
|
||||
var tools = {
|
||||
'arrow_up': 'LineToolArrowMarkUp',
|
||||
'arrow_down': 'LineToolArrowMarkDown',
|
||||
'flag': 'LineToolFlagMark'
|
||||
};
|
||||
|
||||
var toolName = tools[data.options.shape];
|
||||
|
||||
if (typeof toolName == "undefined") {
|
||||
toolName = tools['flag'];
|
||||
}
|
||||
|
||||
if (toolName != tools['flag'] && !!data.options.text) {
|
||||
properties = new DefaultProperty("linetoolarrowmark");
|
||||
properties.text.setValue(data.options.text);
|
||||
}
|
||||
|
||||
var tool = chartWidget.model().createLineTool(pane, point, toolName, properties);
|
||||
|
||||
if (!!data.options.lock && data.options.lock) {
|
||||
tool.setUserEditEnabled(false);
|
||||
}
|
||||
|
||||
// TODO: assign onClick handler here
|
||||
|
||||
pm.post(window.parent, 'onIconCreated', "<icon_uid_here>");
|
||||
});
|
||||
|
||||
|
||||
ChartSaverInstance = new ChartSaver(chartWidgetCollection);
|
||||
|
||||
|
||||
var pm = TradingView.postMessageWrapper(window.parent);
|
||||
(function() {
|
||||
|
||||
pm.on('symbolInfo', function (data, callback) {
|
||||
var symbolInfo = chartWidget.model().mainSeries().symbolInfo(),
|
||||
chartWidget.model().mainSeries().onSymbolResolved().subscribe(null, function() {
|
||||
var symbolInfo = chartWidget.model().mainSeries().symbolInfo(),
|
||||
interval = chartWidget.model().mainSeries().properties().interval.value(),
|
||||
result = {
|
||||
name: symbolInfo.name,
|
||||
@@ -214,136 +305,81 @@ var pm = TradingView.postMessageWrapper(window.parent);
|
||||
type: symbolInfo.type,
|
||||
interval: interval
|
||||
};
|
||||
callback(result);
|
||||
});
|
||||
|
||||
|
||||
pm.on('initializationFinished', function() {
|
||||
TradingView.UndoHistory.clearStack();
|
||||
});
|
||||
|
||||
|
||||
pm.on('widgetReady', function(data, cb) {
|
||||
chartWidget.withModel(null, function () {
|
||||
if (chartWidget.model().mainSeries().bars().size() > 0) {
|
||||
cb();
|
||||
} else {
|
||||
var eventHandler = function() {
|
||||
cb();
|
||||
chartWidget.model().mainSeries().onBarReceived().unsubscribe(null, eventHandler);
|
||||
};
|
||||
chartWidget.model().mainSeries().onBarReceived().subscribe(null, eventHandler);
|
||||
}
|
||||
pm.post(window.parent, 'onSymbolChange', result);
|
||||
});
|
||||
});
|
||||
|
||||
pm.on('createStudy', function(options) {
|
||||
var metainfo = StudyMetaInfo.findStudyMetaInfoByDescription(chartWidget.model().studiesMetaData(), options.name);
|
||||
var study = chartWidget.model().insertStudy(metainfo, {}, false);
|
||||
|
||||
if (!!options.lock && options.lock) {
|
||||
study.setUserEditEnabled(false);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
pm.on('loadChart', function(content) {
|
||||
reloadChart(content);
|
||||
});
|
||||
ChartApiInstance.on('realtime_tick', function(tick) {
|
||||
pm.post(window.parent, 'onTick', tick);
|
||||
});
|
||||
|
||||
ChartApiInstance.on('onAutoSaveNeeded', function(tick) {
|
||||
pm.post(window.parent, 'onAutoSaveNeeded', tick);
|
||||
});
|
||||
|
||||
|
||||
pm.on('saveChart', function() {
|
||||
var savedData = ChartSaverInstance.saveToJSON();
|
||||
pm.post(window.parent, 'onChartSaved', JSON.parse(savedData.content));
|
||||
});
|
||||
})();
|
||||
};
|
||||
|
||||
|
||||
pm.on('changeSymbol', function(data) {
|
||||
TradingView.Linking.symbol.setValue(data.symbol);
|
||||
TradingView.Linking.interval.setValue(data.interval);
|
||||
});
|
||||
|
||||
|
||||
pm.on('removeIcon', function(iconUID) {
|
||||
;
|
||||
});
|
||||
|
||||
pm.on('createShape', function(data) {
|
||||
var barIndex = chartWidget.model().timeScale().timePointToIndex(data.point.time)
|
||||
var point = { index: barIndex };
|
||||
|
||||
if (!!data.point.price) {
|
||||
point.price = data.point.price;
|
||||
}
|
||||
else {
|
||||
var indexes = ['open', 'high', 'low', 'close'];
|
||||
|
||||
var indexOffset = !!data.point.channel
|
||||
? indexes.indexOf(data.point.channel) + 1
|
||||
: 1;
|
||||
|
||||
if (indexOffset <= 0) {
|
||||
indexOffset = 1;
|
||||
}
|
||||
|
||||
point.price = chartWidget.model().mainSeries().data().valueAt(barIndex)[indexOffset];
|
||||
}
|
||||
|
||||
var pane = chartWidget._paneWidgets[0]._state;
|
||||
var properties = undefined;
|
||||
|
||||
var tools = {
|
||||
'arrow_up': 'LineToolArrowMarkUp',
|
||||
'arrow_down': 'LineToolArrowMarkDown',
|
||||
'flag': 'LineToolFlagMark'
|
||||
};
|
||||
|
||||
var toolName = tools[data.options.shape];
|
||||
|
||||
if (typeof toolName == "undefined") {
|
||||
toolName = tools['flag'];
|
||||
}
|
||||
|
||||
if (toolName != tools['flag'] && !!data.options.text) {
|
||||
properties = new DefaultProperty("linetoolarrowmark");
|
||||
properties.text.setValue(data.options.text);
|
||||
}
|
||||
|
||||
var tool = chartWidget.model().createLineTool(pane, point, toolName, properties);
|
||||
|
||||
if (!!data.options.lock && data.options.lock) {
|
||||
tool.setUserEditEnabled(false);
|
||||
}
|
||||
|
||||
// TODO: assign onClick handler here
|
||||
|
||||
pm.post(window.parent, 'onIconCreated', "<icon_uid_here>");
|
||||
});
|
||||
|
||||
|
||||
chartWidget.model().mainSeries().onSymbolResolved().subscribe(null, function() {
|
||||
var symbolInfo = chartWidget.model().mainSeries().symbolInfo(),
|
||||
interval = chartWidget.model().mainSeries().properties().interval.value(),
|
||||
result = {
|
||||
name: symbolInfo.name,
|
||||
exchange: symbolInfo.exchange,
|
||||
description: symbolInfo.description,
|
||||
type: symbolInfo.type,
|
||||
interval: interval
|
||||
};
|
||||
|
||||
pm.post(window.parent, 'onSymbolChange', result);
|
||||
});
|
||||
|
||||
|
||||
ChartApiInstance.on('realtime_tick', function(tick) {
|
||||
pm.post(window.parent, 'onTick', tick);
|
||||
});
|
||||
|
||||
|
||||
})();
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<!-- =============================================================================================== -->
|
||||
<!-- =============================================================================================== -->
|
||||
<!-- =============================================================================================== -->
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
urlParams = (function () {
|
||||
var match,
|
||||
pl = /\+/g, // Regex for replacing addition symbol with a space
|
||||
search = /([^&=]+)=?([^&]*)/g,
|
||||
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
|
||||
query = window.location.search.substring(1),
|
||||
result = {};
|
||||
|
||||
while (match = search.exec(query)) {
|
||||
result[decode(match[1])] = decode(match[2]);
|
||||
}
|
||||
return result;
|
||||
})();
|
||||
|
||||
|
||||
$(window).load(function(){
|
||||
$(window).resize();
|
||||
$('.loading-indicator').hide();
|
||||
});
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
lng: urlParams.locale,
|
||||
load: 'unspecific',
|
||||
resGetPath: "localization/translations/__lng__.json",
|
||||
// debug: true,
|
||||
keyseparator: "@",
|
||||
nsseparator: "@",
|
||||
fallbackLng: "en"
|
||||
};
|
||||
|
||||
$.i18n.init(options, function(t) {
|
||||
$("html").i18n();
|
||||
createChart();
|
||||
|
||||
$(window).resize();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<!-- =============================================================================================== -->
|
||||
<!-- =============================================================================================== -->
|
||||
<!-- =============================================================================================== -->
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||