From f1ed712b3f7b3381738a3564d20b11258256a34e Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Sun, 4 Aug 2024 01:18:11 +0330 Subject: [PATCH] add support for alert in Initialization and DeInitialization ... --- Experts/x-strategies.ea.mq5 | 15 +++++++++++++-- Experts/x-test-strategies.ea.mq5 | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/Experts/x-strategies.ea.mq5 b/Experts/x-strategies.ea.mq5 index c586ddeb..f2462daa 100644 --- a/Experts/x-strategies.ea.mq5 +++ b/Experts/x-strategies.ea.mq5 @@ -67,8 +67,8 @@ input group "Risk Management"; // // Risk Management > Trade Management ... input group "Trade Management"; -input double eaAllowLong = true; // Allow Long Positions -input double eaAllowShort = true; // Allow Short Positions +input bool eaAllowLong = true; // Allow Long Positions +input bool eaAllowShort = true; // Allow Short Positions input int eaMaxAllowedLongs = 1; // Max Allowed Long Positions input int eaMaxAllowedShorts = 1; // Max Allowed Short Positions input double eaMaxDrawdownPercentForOpenTrades = 3; // Max Drawdown Percent for Open Trades @@ -178,6 +178,11 @@ int OnInit() // EventSetTimer(1); // EventSetMillisecondTimer(100); + // + // Alert Initialization ... + string msg = "Initialized Successfully ..."; + eaAlert.Alert(msg); + // // Init Succeed ... return INIT_SUCCEEDED; @@ -203,6 +208,12 @@ void OnDeinit(const int reason) string msg = "MaxSameTimeTrades: " + ToString(eaTradeHandler.MaxSameTimeTrades()); eaAlert.Alert(msg); + // + // Alert De Initialization Succeeded ... + msg = "De Initialized Successfully ..."; + eaAlert.Alert(msg); + + // // De Initialize XSampleEA Providers ... delete mCTHelper; diff --git a/Experts/x-test-strategies.ea.mq5 b/Experts/x-test-strategies.ea.mq5 index 11de2168..ba54d120 100644 --- a/Experts/x-test-strategies.ea.mq5 +++ b/Experts/x-test-strategies.ea.mq5 @@ -62,8 +62,8 @@ double eaSLPoint = 500; // Static SL Point // // Risk Management > Trade Management ... -double eaAllowLong = true; // Allow Long Positions -double eaAllowShort = true; // Allow Short Positions +bool eaAllowLong = true; // Allow Long Positions +bool eaAllowShort = true; // Allow Short Positions int eaMaxAllowedLongs = 1; // Max Allowed Long Positions int eaMaxAllowedShorts = 1; // Max Allowed Short Positions double eaMaxDrawdownPercentForOpenTrades = 3; // Max Drawdown Percent for Open Trades @@ -165,6 +165,11 @@ int OnInit() // EventSetTimer(1); // EventSetMillisecondTimer(100); + // + // Alert Initialization ... + string msg = "Initialized Successfully ..."; + eaAlert.Alert(msg); + // // Init Succeed ... return INIT_SUCCEEDED; @@ -190,6 +195,12 @@ void OnDeinit(const int reason) string msg = "MaxSameTimeTrades: " + ToString(eaTradeHandler.MaxSameTimeTrades()); eaAlert.Alert(msg); + // + // Alert De Initialization Succeeded ... + msg = "De Initialized Successfully ..."; + eaAlert.Alert(msg); + + // // De Initialize XSampleEA Providers ... delete mCTHelper;