tickrpice button toggle workaround
This commit is contained in:
@ -196,7 +196,7 @@
|
|||||||
<div id="controls">
|
<div id="controls">
|
||||||
<button id="button_edit_arch" class="btn btn-outline-success btn-sm">Edit(a)</button>
|
<button id="button_edit_arch" class="btn btn-outline-success btn-sm">Edit(a)</button>
|
||||||
<button id="button_delete_arch" class="btn btn-outline-success btn-sm">Delete(d)</button>
|
<button id="button_delete_arch" class="btn btn-outline-success btn-sm">Delete(d)</button>
|
||||||
<button id="button_show_arch" class="btn btn-outline-success btn-sm">Show</button>
|
<button id="button_show_arch" class="btn btn-outline-success btn-sm">Show(w)</button>
|
||||||
<button id="button_refresh" class="refresh btn btn-outline-success btn-sm">Refresh</button>
|
<button id="button_refresh" class="refresh btn btn-outline-success btn-sm">Refresh</button>
|
||||||
<button id="button_compare_arch" class="refresh btn btn-outline-success btn-sm">Compare</button>
|
<button id="button_compare_arch" class="refresh btn btn-outline-success btn-sm">Compare</button>
|
||||||
<button id="button_runagain_arch" class="refresh btn btn-outline-success btn-sm">Run Again(r)</button>
|
<button id="button_runagain_arch" class="refresh btn btn-outline-success btn-sm">Run Again(r)</button>
|
||||||
@ -306,7 +306,7 @@
|
|||||||
<button id="button_copy" class="btn btn-outline-success btn-sm">Copy JSON</button>
|
<button id="button_copy" class="btn btn-outline-success btn-sm">Copy JSON</button>
|
||||||
<button id="button_delete" class="btn btn-outline-success btn-sm">Delete</button>
|
<button id="button_delete" class="btn btn-outline-success btn-sm">Delete</button>
|
||||||
<button id="button_compare" class="btn btn-outline-success btn-sm">Compare</button>
|
<button id="button_compare" class="btn btn-outline-success btn-sm">Compare</button>
|
||||||
<button id="button_run" class="btn btn-outline-success btn-sm">Run Strategy</button>
|
<button id="button_run" class="btn btn-outline-success btn-sm">Run Strategy(y)</button>
|
||||||
<button id="button_refresh" class="refresh btn btn-outline-success btn-sm">Refresh</button>
|
<button id="button_refresh" class="refresh btn btn-outline-success btn-sm">Refresh</button>
|
||||||
</div>
|
</div>
|
||||||
<table id="stratinTable" class="table-striped table dataTable" style="width:100%; border-color: #dce1dc;">
|
<table id="stratinTable" class="table-striped table dataTable" style="width:100%; border-color: #dce1dc;">
|
||||||
|
|||||||
@ -634,7 +634,10 @@ function chart_archived_run(archRecord, data, oneMinuteBars) {
|
|||||||
|
|
||||||
//remove CUSTOMS indicators if exists
|
//remove CUSTOMS indicators if exists
|
||||||
indList.forEach((element, index, array) => {
|
indList.forEach((element, index, array) => {
|
||||||
chart.removeSeries(element.series);
|
if (element.series) {
|
||||||
|
//console.log(element.series, "tady series")
|
||||||
|
chart.removeSeries(element.series);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
indList = [];
|
indList = [];
|
||||||
|
|||||||
@ -141,7 +141,7 @@ $(document).ready(function () {
|
|||||||
//edit button
|
//edit button
|
||||||
$('#button_edit_arch').click(function () {
|
$('#button_edit_arch').click(function () {
|
||||||
row = archiveRecords.row('.selected').data();
|
row = archiveRecords.row('.selected').data();
|
||||||
if (rows == undefined) {
|
if (row == undefined) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
window.$('#editModalArchive').modal('show');
|
window.$('#editModalArchive').modal('show');
|
||||||
@ -171,6 +171,9 @@ $(document).ready(function () {
|
|||||||
//show button
|
//show button
|
||||||
$('#button_show_arch').click(function () {
|
$('#button_show_arch').click(function () {
|
||||||
row = archiveRecords.row('.selected').data();
|
row = archiveRecords.row('.selected').data();
|
||||||
|
if (row == undefined) {
|
||||||
|
return
|
||||||
|
}
|
||||||
$('#button_show_arch').attr('disabled',true);
|
$('#button_show_arch').attr('disabled',true);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url:"/archived_runners_detail/"+row.id,
|
url:"/archived_runners_detail/"+row.id,
|
||||||
|
|||||||
@ -460,6 +460,9 @@ $(document).ready(function () {
|
|||||||
//button run
|
//button run
|
||||||
$('#button_run').click(function () {
|
$('#button_run').click(function () {
|
||||||
row = stratinRecords.row('.selected').data();
|
row = stratinRecords.row('.selected').data();
|
||||||
|
if (row == undefined) {
|
||||||
|
return
|
||||||
|
}
|
||||||
window.$('#runModal').modal('show');
|
window.$('#runModal').modal('show');
|
||||||
$('#bt_from').val(localStorage.getItem("bt_from"));
|
$('#bt_from').val(localStorage.getItem("bt_from"));
|
||||||
//console.log(localStorage.getItem("bt_from"))
|
//console.log(localStorage.getItem("bt_from"))
|
||||||
|
|||||||
@ -198,10 +198,12 @@ function update_chart_legend(param) {
|
|||||||
//iterate of custom indicators dictionary to get values of custom lines
|
//iterate of custom indicators dictionary to get values of custom lines
|
||||||
// var customIndicator = {name: key, series: null}
|
// var customIndicator = {name: key, series: null}
|
||||||
indList.forEach(function (item) {
|
indList.forEach(function (item) {
|
||||||
|
if (item.series) {
|
||||||
var ind = param.seriesData.get(item.series)
|
var ind = param.seriesData.get(item.series)
|
||||||
var color = item.series.options().color;
|
var color = item.series.options().color;
|
||||||
var visibility = item.series.options().visible;
|
var visibility = item.series.options().visible;
|
||||||
if (ind !== undefined && visibility) { firstRow.innerHTML += name(item.name, color) + val(ind.value.toFixed(3), color)}
|
if (ind !== undefined && visibility) { firstRow.innerHTML += name(item.name, color) + val(ind.value.toFixed(3), color)}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -361,8 +363,10 @@ function populate_indicator_buttons(def) {
|
|||||||
vis = false;
|
vis = false;
|
||||||
}
|
}
|
||||||
elem.classList.toggle("switcher-active-item");
|
elem.classList.toggle("switcher-active-item");
|
||||||
|
if (indList[index].series) {
|
||||||
indList[index].series.applyOptions({
|
indList[index].series.applyOptions({
|
||||||
visible: vis });
|
visible: vis });
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -373,8 +377,22 @@ function populate_indicator_buttons(def) {
|
|||||||
vis = false;
|
vis = false;
|
||||||
}
|
}
|
||||||
elem.classList.toggle("switcher-active-item");
|
elem.classList.toggle("switcher-active-item");
|
||||||
|
//v ifu kvuli workaroundu
|
||||||
|
if (indList[index].series) {
|
||||||
indList[index].series.applyOptions({
|
indList[index].series.applyOptions({
|
||||||
visible: vis });
|
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;
|
return buttonElement;
|
||||||
}
|
}
|
||||||
@ -497,6 +515,9 @@ Mousetrap.bind('d', function() {
|
|||||||
Mousetrap.bind('c', function() {
|
Mousetrap.bind('c', function() {
|
||||||
$( "#button_copy" ).trigger( "click" );
|
$( "#button_copy" ).trigger( "click" );
|
||||||
});
|
});
|
||||||
|
Mousetrap.bind('y', function() {
|
||||||
|
$( "#button_run" ).trigger( "click" );
|
||||||
|
});
|
||||||
Mousetrap.bind('r', function() {
|
Mousetrap.bind('r', function() {
|
||||||
$( "#button_runagain_arch" ).trigger( "click" );
|
$( "#button_runagain_arch" ).trigger( "click" );
|
||||||
});
|
});
|
||||||
@ -515,7 +536,14 @@ Mousetrap.bind('j', function() {
|
|||||||
Mousetrap.bind('x', function() {
|
Mousetrap.bind('x', function() {
|
||||||
$( "#button_delete" ).trigger( "click" );
|
$( "#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) {
|
// function compareObjects(obj1, obj2) {
|
||||||
// const diff = {};
|
// const diff = {};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user