Fix critical EA architecture issues

This commit is contained in:
peter
2026-05-28 17:34:34 -04:00
parent 2682cfdca1
commit 6208bbd9c5
5 changed files with 46 additions and 9 deletions
+10
View File
@@ -48,6 +48,10 @@ int OnInit()
if(!g_market_data.IsTradingAllowed())
{
g_logger.Error("Trading not allowed for this symbol");
delete g_market_data;
g_market_data = NULL;
delete g_logger;
g_logger = NULL;
return INIT_FAILED;
}
@@ -56,6 +60,12 @@ int OnInit()
if(!g_strategy.Init())
{
g_logger.Error("Failed to initialize strategy");
delete g_strategy;
g_strategy = NULL;
delete g_market_data;
g_market_data = NULL;
delete g_logger;
g_logger = NULL;
return INIT_FAILED;
}