diff --git a/mt5_correlation/correlation.py b/mt5_correlation/correlation.py index 2864c7c..34ff9fc 100644 --- a/mt5_correlation/correlation.py +++ b/mt5_correlation/correlation.py @@ -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. diff --git a/mt5_correlation/gui.py b/mt5_correlation/gui.py index 01e56e7..9d6d4c5 100644 --- a/mt5_correlation/gui.py +++ b/mt5_correlation/gui.py @@ -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): """ diff --git a/requirements.txt b/requirements.txt index 4402b70..5f47362 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,4 +6,5 @@ scipy==1.6.0 logging==0.4.9.6 pyyaml==5.4.1 wxpython==4.1.1 -mock==4.0.3 \ No newline at end of file +mock==4.0.3 +numpy==1.20.0 \ No newline at end of file