diff --git a/v2realbot/static/index.html b/v2realbot/static/index.html
index c7b1fa7..4b3766e 100644
--- a/v2realbot/static/index.html
+++ b/v2realbot/static/index.html
@@ -196,7 +196,7 @@
-
+
@@ -306,7 +306,7 @@
-
+
diff --git a/v2realbot/static/js/archivechart.js b/v2realbot/static/js/archivechart.js
index 5cbee3e..d3903a7 100644
--- a/v2realbot/static/js/archivechart.js
+++ b/v2realbot/static/js/archivechart.js
@@ -634,7 +634,10 @@ function chart_archived_run(archRecord, data, oneMinuteBars) {
//remove CUSTOMS indicators if exists
indList.forEach((element, index, array) => {
- chart.removeSeries(element.series);
+ if (element.series) {
+ //console.log(element.series, "tady series")
+ chart.removeSeries(element.series);
+ }
}
);
indList = [];
diff --git a/v2realbot/static/js/archivetables.js b/v2realbot/static/js/archivetables.js
index 274942d..f2242f2 100644
--- a/v2realbot/static/js/archivetables.js
+++ b/v2realbot/static/js/archivetables.js
@@ -141,7 +141,7 @@ $(document).ready(function () {
//edit button
$('#button_edit_arch').click(function () {
row = archiveRecords.row('.selected').data();
- if (rows == undefined) {
+ if (row == undefined) {
return
}
window.$('#editModalArchive').modal('show');
@@ -171,6 +171,9 @@ $(document).ready(function () {
//show button
$('#button_show_arch').click(function () {
row = archiveRecords.row('.selected').data();
+ if (row == undefined) {
+ return
+ }
$('#button_show_arch').attr('disabled',true);
$.ajax({
url:"/archived_runners_detail/"+row.id,
diff --git a/v2realbot/static/js/mytables.js b/v2realbot/static/js/mytables.js
index c8a5a74..7a2a90d 100644
--- a/v2realbot/static/js/mytables.js
+++ b/v2realbot/static/js/mytables.js
@@ -460,6 +460,9 @@ $(document).ready(function () {
//button run
$('#button_run').click(function () {
row = stratinRecords.row('.selected').data();
+ if (row == undefined) {
+ return
+ }
window.$('#runModal').modal('show');
$('#bt_from').val(localStorage.getItem("bt_from"));
//console.log(localStorage.getItem("bt_from"))
diff --git a/v2realbot/static/js/utils.js b/v2realbot/static/js/utils.js
index 5eb1d78..132d524 100644
--- a/v2realbot/static/js/utils.js
+++ b/v2realbot/static/js/utils.js
@@ -198,10 +198,12 @@ function update_chart_legend(param) {
//iterate of custom indicators dictionary to get values of custom lines
// var customIndicator = {name: key, series: null}
indList.forEach(function (item) {
+ if (item.series) {
var ind = param.seriesData.get(item.series)
var color = item.series.options().color;
var visibility = item.series.options().visible;
if (ind !== undefined && visibility) { firstRow.innerHTML += name(item.name, color) + val(ind.value.toFixed(3), color)}
+ }
});
}
else {
@@ -361,8 +363,10 @@ function populate_indicator_buttons(def) {
vis = false;
}
elem.classList.toggle("switcher-active-item");
+ if (indList[index].series) {
indList[index].series.applyOptions({
visible: vis });
+ }
})
}
@@ -373,8 +377,22 @@ function populate_indicator_buttons(def) {
vis = false;
}
elem.classList.toggle("switcher-active-item");
+ //v ifu kvuli workaroundu
+ if (indList[index].series) {
indList[index].series.applyOptions({
visible: vis });
+ }
+ //zatim takto workaround, pak vymyslet systemove pro vsechny tickbased indikatory
+ if (indList[index].name == "tick_price") {
+ if (!vis && indList[index].series) {
+ chart.removeSeries(indList[index].series)
+ chart.timeScale().fitContent();
+ indList[index].series = null
+ }
+ }
+
+
+
}
return buttonElement;
}
@@ -497,6 +515,9 @@ Mousetrap.bind('d', function() {
Mousetrap.bind('c', function() {
$( "#button_copy" ).trigger( "click" );
});
+Mousetrap.bind('y', function() {
+ $( "#button_run" ).trigger( "click" );
+});
Mousetrap.bind('r', function() {
$( "#button_runagain_arch" ).trigger( "click" );
});
@@ -515,7 +536,14 @@ Mousetrap.bind('j', function() {
Mousetrap.bind('x', function() {
$( "#button_delete" ).trigger( "click" );
});
+Mousetrap.bind('w', function() {
+ $( "#button_show_arch" ).trigger( "click" );
+});
+//ENTERS
+// Mousetrap.bind('enter', function() {
+// $( "#deletearchive" ).trigger( "click" );
+// });
// function compareObjects(obj1, obj2) {
// const diff = {};