2021-02-10 18:21:49 +00:00
|
|
|
"""
|
|
|
|
|
Application to monitor previously correlated symbol pairs for correlation divergence.
|
|
|
|
|
"""
|
2021-02-02 16:48:52 +00:00
|
|
|
import definitions
|
2021-02-10 18:21:49 +00:00
|
|
|
import logging.config
|
|
|
|
|
from mt5_correlation.gui import MonitorFrame
|
|
|
|
|
from mt5_correlation.config import Config
|
|
|
|
|
import wx
|
2021-02-17 18:24:48 +00:00
|
|
|
import wx.lib.mixins.inspection as wit
|
|
|
|
|
|
|
|
|
|
|
2021-02-22 12:32:39 +00:00
|
|
|
class InspectionApp(wx.App, wit.InspectionMixin):
|
2021-02-17 18:24:48 +00:00
|
|
|
# Override app to use inspection.
|
|
|
|
|
def OnInit(self):
|
|
|
|
|
self.Init() # initialize the inspection tool
|
|
|
|
|
return True
|
|
|
|
|
|
2021-02-10 18:21:49 +00:00
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
# Load the config
|
2021-02-16 17:15:00 +00:00
|
|
|
Config().load(fr"{definitions.ROOT_DIR}\config.yaml")
|
|
|
|
|
|
|
|
|
|
# Get logging config and configure the logger
|
|
|
|
|
log_config = Config().get('logging')
|
|
|
|
|
logging.config.dictConfig(log_config)
|
2021-02-10 18:21:49 +00:00
|
|
|
|
2021-02-22 12:32:39 +00:00
|
|
|
# Do we have inspection turned on. Create correct version of app
|
|
|
|
|
inspection = Config().get('developer.inspection')
|
|
|
|
|
if inspection:
|
|
|
|
|
app = InspectionApp()
|
|
|
|
|
else:
|
|
|
|
|
app = wx.App(False)
|
|
|
|
|
|
2021-02-10 18:21:49 +00:00
|
|
|
# Start the app
|
2021-02-16 17:15:00 +00:00
|
|
|
frame = MonitorFrame()
|
2021-02-10 18:21:49 +00:00
|
|
|
frame.Show()
|
|
|
|
|
app.MainLoop()
|