Fix critical EA architecture issues
This commit is contained in:
+10
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user