Clear last check and last coefficient column on clear history.

This commit is contained in:
Jamie Cash
2021-03-11 09:50:52 +00:00
parent 8c2cbf5df8
commit ab6c2ae338
3 changed files with 15 additions and 6 deletions
+5
View File
@@ -10,6 +10,7 @@ from scipy.stats.stats import pearsonr
import pickle
import inspect
import sys
import numpy as np
from mt5_correlation.mt5 import MT5
@@ -369,6 +370,10 @@ class Correlation:
# Clear tick data
self.__monitor_tick_data = {}
# Clear columns from coefficient data
self.coefficient_data['Last Check'] = np.NaN
self.coefficient_data['Last Coefficient'] = np.NaN
def get_ticks(self, symbol, date_from=None, date_to=None, cache_time=0, cache_only=False):
"""
Returns the ticks for the specified symbol. Get's from cache if available and not older than cache_timeframe.
+8 -5
View File
@@ -163,7 +163,7 @@ class MonitorFrame(wx.Frame):
self.__cor.load(self.__opened_filename)
# Refresh data in grid
self.refresh_grid()
self.__refresh_grid()
self.SetStatusText(f"File {self.__opened_filename} loaded.", 1)
@@ -208,13 +208,13 @@ class MonitorFrame(wx.Frame):
self.SetStatusText("", 1)
# Show calculated data
self.refresh_grid()
self.__refresh_grid()
def quit(self, event):
# Close
self.Close()
def refresh_grid(self):
def __refresh_grid(self):
"""
Refreshes grid. Notifies if rows have been added or deleted.
:return:
@@ -346,7 +346,7 @@ class MonitorFrame(wx.Frame):
if reload_correlations:
self.__log.info("Settings updated. Updating monitoring threshold and reloading grid.")
self.__cor.monitoring_threshold = self.__config.get("monitor.monitoring_threshold")
self.refresh_grid()
self.__refresh_grid()
if reload_logger:
self.__log.info("Settings updated. Reloading logger.")
@@ -438,7 +438,7 @@ class MonitorFrame(wx.Frame):
Called on timer event. Refreshes grid and updates selected graph.
:return:
"""
self.refresh_grid()
self.__refresh_grid()
if len(self.__selected_correlation) == 2:
self.show_graph(symbol1=self.__selected_correlation[0], symbol2=self.__selected_correlation[1])
@@ -456,6 +456,9 @@ class MonitorFrame(wx.Frame):
if len(self.__selected_correlation) == 2:
self.show_graph(symbol1=self.__selected_correlation[0], symbol2=self.__selected_correlation[1])
# Reload the table
self.__refresh_grid()
class DataTable(wx.grid.GridTableBase):
"""