From 144fd909763d16a6c92f288e11b74ea94055f4df Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Tue, 18 Jun 2024 14:32:58 +0330 Subject: [PATCH] last ... --- Experts/x-saherelm.x121.ea.mq5 | 76 +++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 16 deletions(-) diff --git a/Experts/x-saherelm.x121.ea.mq5 b/Experts/x-saherelm.x121.ea.mq5 index bbd0cab6..b0f8a8e1 100644 --- a/Experts/x-saherelm.x121.ea.mq5 +++ b/Experts/x-saherelm.x121.ea.mq5 @@ -39,11 +39,13 @@ input int x121EASlippage = 10; // Slippgae // Signals ... // EURUSDb,GBPUSDb,XAUUSDb,USDCHFb,USDJPYb input group "Signals"; -input string x121EASymbols = "EURUSDb"; // Symbols -input bool x121EAAllowLong = true; // Allow Long Trades -input bool x121EAAllowShort = true; // Allow Short Trades -input int x121EAReuiredSignalVerifications = 4; // Required Verifications for Signals -input bool x121EAGetVerificationFromOtherTimeFrames = true; // Get Verifications from Other Time Frames +input string x121EASymbols = "EURUSDb,USDCHFb,EURCHFb,USDJPYb,EURJPYb,GBPUSDb,XAUUSDb,NZDUSDb,AUDUSDb,USDCADb,BTCUSD,ETHUSD"; // Symbols +input bool x121EAUseAllSymbols = false; // Use All Available Symbols +input bool x121EAUseAllWatchListSymbols = false; // Use All WatchList Symbols +input bool x121EAAllowLong = true; // Allow Long Trades +input bool x121EAAllowShort = true; // Allow Short Trades +input int x121EAReuiredSignalVerifications = 5; // Required Verifications for Signals +input bool x121EAGetVerificationFromOtherTimeFrames = true; // Get Verifications from Other Time Frames // // Risk Management ... @@ -89,7 +91,7 @@ input double x121EAMaxAllowedGridVolume = 0.04; // Max Allowed Grid Signals Volu // input group "Recovery"; -input bool x121EAAllowRecovery = true; // Allow Recovery Signals +input bool x121EAAllowRecovery = false; // Allow Recovery Signals input int x121EAMaxNumberOfRecoveries = 3; // Max Number of Recovery Signals input double x121EARecoveryDistance = 100; // Recovery Distance input double x121EARecoveryVolumeMultiplier = 2; // Recovery Volume Multiplier @@ -182,19 +184,61 @@ bool InitialEA() TesterHideIndicators(true); // - result = IsValid(x121EASymbols); - if (!result) - { - return result; - } + string inputSymbols[]; + int inputSymbolsCount = SplitContent( + inputSymbols, + x121EASymbols // + ); + + // + string allSymbols[]; + int allSymbolsCount = GetAllSymbols( + allSymbols // + ); + + // + string watchListSymbols[]; + int watchListSymbolsCount = GetAllSymbols( + watchListSymbols, + true // + ); // string symbols[]; - int symbolsCount = SplitContent( - symbols, - x121EASymbols // - ); - result = symbolsCount > 0; + if (x121EAUseAllSymbols) + { + // + Copy( + allSymbols, + symbols // + ); + } + else if (x121EAUseAllWatchListSymbols) + { + // + Copy( + watchListSymbols, + symbols // + ); + } + else if (IsValidSize(inputSymbolsCount)) + { + // + Copy( + inputSymbols, + symbols // + ); + } + else + { + // + Add( + _Symbol, + symbols // + ); + } + int symbolsCount = ArraySize(symbols); + result = IsValidSize(symbolsCount); if (!result) { return result;