From 9dd5ff3e7302a18f0a244a9b22552b411cca919f Mon Sep 17 00:00:00 2001 From: David Brazda Date: Tue, 9 May 2023 12:13:02 +0200 Subject: [PATCH] bugfix --- testy/testRushHours.py | 17 +++++++++++++++++ v2realbot/static/js/mytables.js | 2 ++ v2realbot/static/js/realtimechart.js | 5 +---- v2realbot/static/js/utils.js | 2 +- 4 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 testy/testRushHours.py diff --git a/testy/testRushHours.py b/testy/testRushHours.py new file mode 100644 index 0000000..c147e0d --- /dev/null +++ b/testy/testRushHours.py @@ -0,0 +1,17 @@ +from v2realbot.utils.utils import is_open_rush, zoneNY +from datetime import datetime, date, timedelta, time + +ted = datetime.now().astimezone(zoneNY) + +ted = datetime(year=2023, month=5, day=9, hour=9, minute=35, tzinfo=zoneNY) +print(ted) + +rush = is_open_rush(ted, 30) + +print(rush) +business_hours = { + "from": time(hour=9, minute=30), + "to": time(hour=16, minute=0) +} +rushtime = (datetime.combine(date.today(), business_hours["from"]) + timedelta(minutes=30)).time() +print(rushtime) \ No newline at end of file diff --git a/v2realbot/static/js/mytables.js b/v2realbot/static/js/mytables.js index 6d24d63..9995dc1 100644 --- a/v2realbot/static/js/mytables.js +++ b/v2realbot/static/js/mytables.js @@ -337,7 +337,9 @@ $(document).ready(function () { row = stratinRecords.row('.selected').data(); window.$('#runModal').modal('show'); $('#bt_from').val(localStorage.getItem("bt_from")); + //console.log(localStorage.getItem("bt_from")) $('#bt_to').val(localStorage.getItem("bt_to")); + //console.log(localStorage.getItem("bt_to")) $('#mode').val(localStorage.getItem("mode")); $('#account').val(localStorage.getItem("account")); $('#debug').val(localStorage.getItem("debug")); diff --git a/v2realbot/static/js/realtimechart.js b/v2realbot/static/js/realtimechart.js index 85b006d..0325c2f 100644 --- a/v2realbot/static/js/realtimechart.js +++ b/v2realbot/static/js/realtimechart.js @@ -1,9 +1,6 @@ function populate_real_time_chart() { - if (chart !== null) { - chart.remove(); - clear_status_header(); - } + cleanup_chart() initialize_chart() intitialize_candles() diff --git a/v2realbot/static/js/utils.js b/v2realbot/static/js/utils.js index e767947..2204eb9 100644 --- a/v2realbot/static/js/utils.js +++ b/v2realbot/static/js/utils.js @@ -86,7 +86,7 @@ function cleanup_chart() { avgBuyLine = null volumeSeries = null vwapSeries = null - if (toolTip !== null) { + if (toolTip) { toolTip.style.display = 'none'; } }