diff --git a/v2realbot/static/js/archivechart.js b/v2realbot/static/js/archivechart.js
index 640e72c..e5d2b5a 100644
--- a/v2realbot/static/js/archivechart.js
+++ b/v2realbot/static/js/archivechart.js
@@ -213,9 +213,10 @@ function chart_archived_run(archRecord, data, oneMinuteBars) {
toolTip = document.createElement('div');
//width: 90px; , height: 80px;
toolTip.style = `position: absolute; display: none; padding: 8px; box-sizing: border-box; font-size: 12px; text-align: left; z-index: 1000; top: 12px; left: 12px; pointer-events: none; border: 1px solid; border-radius: 2px;font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;`;
- toolTip.style.background = 'white';
- toolTip.style.color = 'black';
- toolTip.style.borderColor = '#2962FF';
+ toolTip.style.backgroundColor = '#2d323e';
+ toolTip.style.color = '#babfcd';
+ toolTip.style.borderColor = "#a7a9b0";
+ //'#2962FF';
container1.appendChild(toolTip);
//initialize chart
document.getElementById("chart").style.display = "block"
@@ -579,7 +580,7 @@ function chart_archived_run(archRecord, data, oneMinuteBars) {
chart.subscribeClick(param => {
$('#trade-timestamp').val(param.time)
- if (archRecord.ilog_save == "true") {
+ if (archRecord.ilog_save == true) {
fetch_log_data(param.time, archRecord.id);
}
if (
@@ -666,13 +667,13 @@ function fetch_log_data(timestamp, runner_id) {
contentType: "application/json",
data: req,
success:function(data){
- console.log("archived logs", JSON.stringify(data))
+ //console.log("archived logs", JSON.stringify(data))
display_log(data, timestamp)
},
error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
window.alert(JSON.stringify(xhr));
- console.log(JSON.stringify(xhr));
+ //console.log(JSON.stringify(xhr));
}
})
}
diff --git a/v2realbot/static/js/archivetables.js b/v2realbot/static/js/archivetables.js
index 5b70b9e..5ac88d4 100644
--- a/v2realbot/static/js/archivetables.js
+++ b/v2realbot/static/js/archivetables.js
@@ -166,22 +166,50 @@ var archiveRecords =
{data: 'bt_from', visible: true},
{data: 'bt_to', visible: true},
{data: 'ilog_save', visible: true},
- {data: 'stratvars', visible: true},
+ {data: 'stratvars', visible: false},
{data: 'profit'},
{data: 'trade_count', visible: true},
{data: 'end_positions', visible: true},
{data: 'end_positions_avgp', visible: true},
{data: 'open_orders', visible: true}
],
- // columnDefs: [{
- // targets: [4,5,8,9],
- // render: function ( data, type, row ) {
- // return format_date(data)
- // },
- // }],
+ paging: false,
+ processing: false,
+ columnDefs: [ {
+ targets: [0,1],
+ render: function ( data, type, row ) {
+ return '
'+data+''
+ },
+ },
+ {
+ targets: [5,6],
+ render: function ( data, type, row ) {
+ now = new Date(data)
+ if (isToday(now)) {
+ //return local time only
+ return 'dnes ' + format_date(data,false,true)
+ }
+ else
+ {
+ //return local datetime
+ return format_date(data,false,false)
+ }
+
+
+ },
+ },
+ {
+ targets: [9,10],
+ render: function ( data, type, row ) {
+ //market datetime
+ return format_date(data, true)
+ },
+ },
+ ],
order: [[6, 'desc']],
- paging: true,
- lengthChange: false,
+ // paging: true,
+ // lengthChange: false,
+ // select: true,
// createdRow: function( row, data, dataIndex){
// if (is_running(data.id) ){
// alert("runner");
diff --git a/v2realbot/static/js/livewebsocket.js b/v2realbot/static/js/livewebsocket.js
index 76505a6..4906e9c 100644
--- a/v2realbot/static/js/livewebsocket.js
+++ b/v2realbot/static/js/livewebsocket.js
@@ -20,7 +20,7 @@ function populate_rt_status_header(runnerId) {
method:"GET",
contentType: "application/json",
success:function(data){
- console.log(JSON.stringify(data))
+ //console.log(JSON.stringify(data))
//add status on chart
$("#statusRegime").text("REALTIME")
$("#statusName").text(data.run_name)
@@ -31,7 +31,7 @@ function populate_rt_status_header(runnerId) {
error: function(xhr, status, error) {
var err = eval("(" + xhr.responseText + ")");
window.alert(JSON.stringify(xhr));
- console.log(JSON.stringify(xhr));
+ //console.log(JSON.stringify(xhr));
}
})
}
diff --git a/v2realbot/static/js/mytables.js b/v2realbot/static/js/mytables.js
index ba27867..45f009d 100644
--- a/v2realbot/static/js/mytables.js
+++ b/v2realbot/static/js/mytables.js
@@ -41,8 +41,6 @@ function is_stratin_running(id) {
//STRATIN and RUNNERS TABELS
$(document).ready(function () {
- //reaload hlavni tabulky
-
stratinRecords.ajax.reload();
runnerRecords.ajax.reload();
@@ -411,8 +409,8 @@ var stratinRecords =
{data: 'id2'},
{data: 'name'},
{data: 'symbol'},
- {data: 'class_name'},
- {data: 'script'},
+ {data: 'class_name', visible: false},
+ {data: 'script', visible: false},
{data: 'open_rush', visible: false},
{data: 'close_rush', visible: false},
{data: 'stratvars_conf', visible: false},
@@ -427,7 +425,14 @@ var stratinRecords =
var status = get_status(data)
return '
'+status+''
},
- }],
+ },
+ {
+ targets: 0,
+ render: function ( data, type, row ) {
+ return '
'+data+''
+ },
+ },
+ ],
order: [[1, 'asc']],
paging: false,
// select: {
@@ -480,6 +485,19 @@ var runnerRecords =
],
paging: false,
processing: false,
+ columnDefs: [ {
+ targets: [0,1],
+ render: function ( data, type, row ) {
+ return '
'+data+''
+ },
+ },
+ {
+ targets: [2],
+ render: function ( data, type, row ) {
+ return format_date(data)
+ },
+ },
+ ],
// select: {
// style: 'multi'
// },
diff --git a/v2realbot/static/js/utils.js b/v2realbot/static/js/utils.js
index 00ae9a2..90c5ae2 100644
--- a/v2realbot/static/js/utils.js
+++ b/v2realbot/static/js/utils.js
@@ -81,17 +81,17 @@ function initialize_chart() {
layout: {
background: {
type: 'solid',
- color: '#000000',
+ color: '#2a2e39',
},
textColor: '#d1d4dc',
},
grid: {
vertLines: {
visible: true,
- color: "#434d46"
+ color: "#434651"
},
horzLines: {
- color: "#667069",
+ color: "#434651",
visible:true
},
},
@@ -191,15 +191,35 @@ JSON.safeStringify = (obj, indent = 2) => {
return retVal;
};
+ function isToday(someDate) {
+ const today = new Date()
+ return someDate.getDate() == today.getDate() &&
+ someDate.getMonth() == today.getMonth() &&
+ someDate.getFullYear() == today.getFullYear()
+ }
+
//https://www.w3schools.com/jsref/jsref_tolocalestring.asp
-function format_date(datum) {
+function format_date(datum, markettime = false, timeonly = false) {
//const options = { weekday: 'long', year: 'numeric', month: 'numeric', day: 'numeric', };
- const options = {dateStyle: "short", timeStyle: "short"}
+ // date.toLocaleString('en-US', {
+ // timeZone: 'America/New_York',
+ // })
+ //'Europe/Berlin'
+ var options = {}
+ if (timeonly) {
+ options = {hour: '2-digit', hour12: false, minute: '2-digit'}
+ }
+ else {
+ options = {dateStyle: "short", timeStyle: "short"}
+ }
+
+ if (markettime) {
+ options["timeZone"] = 'America/New_York'
+ }
const date = new Date(datum);
return date.toLocaleString('cs-CZ', options);
}
-
function clear_status_header() {
$("#statusRegime").text("")
$("#statusName").text("")
diff --git a/v2realbot/static/main.css b/v2realbot/static/main.css
index 29ce6a8..29e703a 100644
--- a/v2realbot/static/main.css
+++ b/v2realbot/static/main.css
@@ -2,7 +2,60 @@
--dt-row-selected: 18, 143, 175;
} */
:root {
- --dt-row-selected: 37, 120, 114;
+ --dt-row-selected: 140,142,141;
+}
+
+[data-bs-theme=dark] {
+ color-scheme: dark;
+ --bs-body-color: #adb5bd;
+ --bs-body-color-rgb: 173,181,189;
+ --bs-body-bg: #2a2e39;
+ --bs-body-bg-rgb: 33,37,41;
+ --bs-emphasis-color: #fff;
+ --bs-emphasis-color-rgb: 255,255,255;
+ --bs-secondary-color: rgba(173, 181, 189, 0.75);
+ --bs-secondary-color-rgb: 173,181,189;
+ --bs-secondary-bg: #343a40;
+ --bs-secondary-bg-rgb: 52,58,64;
+ --bs-tertiary-color: rgba(173, 181, 189, 0.5);
+ --bs-tertiary-color-rgb: 173,181,189;
+ --bs-tertiary-bg: #2b3035;
+ --bs-tertiary-bg-rgb: 43,48,53;
+ --bs-primary-text-emphasis: #6ea8fe;
+ --bs-secondary-text-emphasis: #a7acb1;
+ --bs-success-text-emphasis: #75b798;
+ --bs-info-text-emphasis: #6edff6;
+ --bs-warning-text-emphasis: #ffda6a;
+ --bs-danger-text-emphasis: #ea868f;
+ --bs-light-text-emphasis: #f8f9fa;
+ --bs-dark-text-emphasis: #dee2e6;
+ --bs-primary-bg-subtle: #031633;
+ --bs-secondary-bg-subtle: #161719;
+ --bs-success-bg-subtle: #051b11;
+ --bs-info-bg-subtle: #032830;
+ --bs-warning-bg-subtle: #332701;
+ --bs-danger-bg-subtle: #2c0b0e;
+ --bs-light-bg-subtle: #343a40;
+ --bs-dark-bg-subtle: #1a1d20;
+ --bs-primary-border-subtle: #084298;
+ --bs-secondary-border-subtle: #41464b;
+ --bs-success-border-subtle: #0f5132;
+ --bs-info-border-subtle: #087990;
+ --bs-warning-border-subtle: #997404;
+ --bs-danger-border-subtle: #842029;
+ --bs-light-border-subtle: #495057;
+ --bs-dark-border-subtle: #343a40;
+ --bs-link-color: #6ea8fe;
+ --bs-link-hover-color: #8bb9fe;
+ --bs-link-color-rgb: 110,168,254;
+ --bs-link-hover-color-rgb: 139,185,254;
+ --bs-code-color: #e685b5;
+ --bs-border-color: #495057;
+ --bs-border-color-translucent: rgba(255, 255, 255, 0.15);
+ --bs-form-valid-color: #75b798;
+ --bs-form-valid-border-color: #75b798;
+ --bs-form-invalid-color: #ea868f;
+ --bs-form-invalid-border-color: #ea868f;
}
tbody, td, tfoot, th, thead, tr {
@@ -12,6 +65,18 @@ tbody, td, tfoot, th, thead, tr {
padding: 4px;
}
+.tdnowrap {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ width: 68px;
+ white-space: nowrap;
+}
+
+table.dataTable thead th, table.dataTable thead td, table.dataTable tfoot th, table.dataTable tfoot td {
+ text-align: left;
+ color: #787b86;
+}
+
.secondary-bg {
--bs-bg-opacity: 1;
background-color: #414749;
@@ -73,7 +138,11 @@ tbody, td, tfoot, th, thead, tr {
}
html {
- font-size: 14px;
+ font-size: 12px;
+}
+
+.table>:not(caption)>*>* {
+ padding: 0.32rem 0.32rem;
}
.flex-container {
@@ -179,7 +248,7 @@ pre {
font-size: normal;
/* font-weight: bold; */
display: flex;
- background-color: #dfe4e6;
+ /* background-color: #dfe4e6; */
/* color: white; */
padding: 1px;
padding-left: 5px;