-
-
-
+
+
+
+
+
+
+ | Id |
+ Id2 |
+ Name |
+ Symbol |
+ class |
+ script |
+ OR |
+ CR |
+ Stratvars |
+ add_data |
+ note |
+ history |
+ |
+ |
+
+
+
+
+
+
-
-
-
-
-
-
+
diff --git a/v2realbot/static/js/mychart.js b/v2realbot/static/js/mychart.js
index e6df4cd..19202b5 100644
--- a/v2realbot/static/js/mychart.js
+++ b/v2realbot/static/js/mychart.js
@@ -1,6 +1,6 @@
//const chartOptions = { layout: { textColor: 'black', background: { type: 'solid', color: 'white' } } };
-const chartOptions = { width: 800, height: 600}
-const chart = LightweightCharts.createChart(document.getElementById('conteiner'), chartOptions);
+const chartOptions = { width: 1200, height: 600}
+const chart = LightweightCharts.createChart(document.getElementById('chart'), chartOptions);
chart.applyOptions({ timeScale: { visible: true, timeVisible: true, secondsVisible: true }, crosshair: {
mode: LightweightCharts.CrosshairMode.Normal, labelVisible: true
}})
@@ -28,15 +28,12 @@ const vwapSeries = chart.addLineSeries({
//TBD dynamicky zobrazovat vsechny indikatory
-document.getElementById('conteiner').style.display = 'inline-block';
-var cont = document.getElementById('conteiner');
-var legend = document.createElement('div');
-legend.classList.add('legend');
-cont.appendChild(legend);
+//document.getElementById('chart').style.display = 'inline-block';
+var legendlist = document.getElementById('legend');
var firstRow = document.createElement('div');
firstRow.innerText = '-';
// firstRow.style.color = 'white';
-legend.appendChild(firstRow);
+legendlist.appendChild(firstRow);
function pad(n) {
var s = ('0' + n);
@@ -49,7 +46,15 @@ chart.subscribeCrosshairMove((param) => {
const vwap = data.value !== undefined ? data.value : data.close;
const bars = param.seriesData.get(candlestickSeries);
const volumes = param.seriesData.get(volumeSeries);
- firstRow.innerText = 'VWAP' + ' ' + vwap.toFixed(2) + " O" + bars.open + " H" + bars.high + " L" + bars.low + " C" + bars.close + " V" + volumes.value;
+ firstRow.innerText = "";
+ //iterate of custom indicators dictionary to get values of custom lines
+ // var customIndicator = {name: key, series: null}
+ indList.forEach(function (item) {
+ const ind = param.seriesData.get(item.series)
+ firstRow.innerText += item.name + " " + ind.value + " ";
+ });
+
+ firstRow.innerText += 'vwap' + ' ' + vwap.toFixed(2) + " o" + bars.open + " h" + bars.high + " l" + bars.low + " c" + bars.close + " v" + volumes.value;
}
else {
firstRow.innerText = '-';
diff --git a/v2realbot/static/js/mytables.js b/v2realbot/static/js/mytables.js
index 3746f25..e47b4ab 100644
--- a/v2realbot/static/js/mytables.js
+++ b/v2realbot/static/js/mytables.js
@@ -9,10 +9,6 @@ function store_api_key(event) {
}
function get_status(id) {
-
- // for (val of stratinRecords.rows().iterator()) {
- // window.alert(JSON.stringify(val))
- // }
var status = "stopped"
runnerRecords.rows().iterator('row', function ( context, index ) {
var data = this.row(index).data();
@@ -32,6 +28,18 @@ function get_status(id) {
return status
}
+function is_running(id) {
+ var running = false
+ runnerRecords.rows().iterator('row', function ( context, index ) {
+ var data = this.row(index).data();
+ //window.alert(JSON.stringify(data))
+ if (data.id == id) {
+ running = true
+ }
+ //window.alert("found") }
+ });
+ return running
+}
// alert(JSON.stringify(stratinRecords.data()))
// arr = stratinRecords.data()
// foreach(row in arr.rows) {
@@ -263,7 +271,13 @@ var stratinRecords =
return '
'+status+''
},
}],
- paging: false
+ paging: false,
+ // createdRow: function( row, data, dataIndex){
+ // if (is_running(data.id) ){
+ // alert("runner");
+ // $(row).addClass('highlight');
+ // }
+ //}
} );
//runner table
diff --git a/v2realbot/static/js/mywebsocket.js b/v2realbot/static/js/mywebsocket.js
index 7ee8feb..4d0b813 100644
--- a/v2realbot/static/js/mywebsocket.js
+++ b/v2realbot/static/js/mywebsocket.js
@@ -1,7 +1,7 @@
+var indList = []
var ws = null;
function connect(event) {
var runnerId = document.getElementById("runnerId")
- var indList = []
try {
ws = new WebSocket("ws://localhost:8000/runners/" + runnerId.value + "/ws?api_key=" + API_KEY);
}
@@ -10,7 +10,7 @@ function connect(event) {
}
ws.onopen = function(event) {
document.getElementById("status").textContent = "Connected to" + runnerId.value
- document.getElementById("bt-disc").style.display = "block"
+ document.getElementById("bt-disc").style.display = "initial"
document.getElementById("bt-conn").style.display = "none"
}
ws.onmessage = function(event) {
@@ -89,7 +89,7 @@ function connect(event) {
ws.onclose = function(event) {
document.getElementById("status").textContent = "Disconnected from" + runnerId.value
document.getElementById("bt-disc").style.display = "none"
- document.getElementById("bt-conn").style.display = "block"
+ document.getElementById("bt-conn").style.display = "initial"
}
event.preventDefault()
}
diff --git a/v2realbot/static/main.css b/v2realbot/static/main.css
new file mode 100644
index 0000000..69c5f49
--- /dev/null
+++ b/v2realbot/static/main.css
@@ -0,0 +1,33 @@
+.flex-container {
+ display: inline-grid;
+ flex-direction: row;
+ flex-wrap: wrap;
+ justify-content: flex-start;
+ align-items: stretch;
+ align-content: normal;
+ }
+
+ .flex-items{
+ display: block;
+ flex-grow: 0;
+ flex-shrink: 1;
+ flex-basis: auto;
+ align-self: auto;
+ order: 0;
+ margin-inline-start: 50px;
+ }
+
+ .chartContainer {
+ position: relative;
+}
+
+.legend {
+ position: absolute;
+ color: #050505;
+ left: 60px;
+ top: 99px;
+ z-index: 1;
+ font-size: 16px;
+ line-height: 18px;
+ font-weight: 300;
+}
\ No newline at end of file