From c5ad6e50c27fac864f5821706422c3942b2d5a63 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Fri, 6 Jun 2025 12:30:20 +0330 Subject: [PATCH] last ... --- .vscode/vscode-kanban.json | 18 +++++ Experts/x-saherelm.x121.xcatb.ea.mq5 | 36 +++++----- XCATBEA/Libraries/xcatbea.signaller.lib.mq5 | 74 +++++++++++++++++++-- 3 files changed, 106 insertions(+), 22 deletions(-) diff --git a/.vscode/vscode-kanban.json b/.vscode/vscode-kanban.json index 70afbecd..0aa7a1bc 100644 --- a/.vscode/vscode-kanban.json +++ b/.vscode/vscode-kanban.json @@ -1,5 +1,14 @@ { "todo": [ + { + "assignedTo": { + "name": "Hadi Khazaee Asl" + }, + "creation_time": "2025-06-06T08:25:14.036Z", + "id": "22", + "references": [], + "title": "add Support for Panel Integrations on EA" + }, { "assignedTo": { "name": "Hadi Khazaee Asl" @@ -17,6 +26,15 @@ "id": "21", "references": [], "title": "test trigger block based inputs and second input signals using Trigger Bar ..." + }, + { + "assignedTo": { + "name": "Hadi Khazaee Asl" + }, + "creation_time": "2025-06-06T08:51:47.616Z", + "id": "23", + "references": [], + "title": "add support for Filtering Signals using Conditions ..." } ], "in-progress": [ diff --git a/Experts/x-saherelm.x121.xcatb.ea.mq5 b/Experts/x-saherelm.x121.xcatb.ea.mq5 index 107f2c06..dbcdd4e0 100644 --- a/Experts/x-saherelm.x121.xcatb.ea.mq5 +++ b/Experts/x-saherelm.x121.xcatb.ea.mq5 @@ -92,19 +92,19 @@ input bool eaFilterBasedOnHKSignalBar = false; // Filter Based On HK Signal Ba // // Signal ... input group "Signal"; -input int eaSignalR2R = 2; // Risk Reward Ratio -input double eaSLATRMultiplier = 0; // ATR Multiplier for SL -input bool eaAllowSignallingBasedOnConditions; // Signalling Based on Market Conditions -input bool eaAllowSignallingBasedOnTriggerBlocks; // Signalling Based on Trigger Blocks -input bool eaAllowSignallingBasedOnTriggerBlocksInsideOther; // Signalling Based on Trigger Blocks Seccond inputs -input bool eaSecondsTriggersSLUsingFirstTriggerBlock; // Use First Trigger Block for SL of Seconds Trigger Block Signalss -input bool eaApplyValidateAndFilterOnSelectInsideOthers; // Select Trigger Blocks by Applying Validations and Filterss -input bool eaAllowSignallingConditions1; // Allow Market Conditions Signaller to Using Sar Signals -input bool eaAllowSignallingConditions2; // Allow Market Conditions Signaller to Using Trend Signals -input bool eaAllowSignallingConditions3; // Allow Market Conditions Signaller to Using Delta Signals -input bool eaAllowSignallingConditions4; // Allow Market Conditions Signaller to Using Volume Signals -input bool eaAllowSignallingConditions5; // Allow Market Conditions Signaller to Using Signal Bar Signals -input bool eaAllowSignallingConditions6; // Allow Market Conditions Signaller to Using HK Signal Bar Signals +input int eaSignalR2R = 2; // Risk Reward Ratio +input double eaSLATRMultiplier = 0; // ATR Multiplier for SL +input bool eaAllowSignallingBasedOnConditions = false; // Signalling Based on Market Conditions +input bool eaAllowSignallingBasedOnTriggerBlocks = false; // Signalling Based on Trigger Blocks +input bool eaAllowSignallingBasedOnTriggerBlocksInsideOther = false; // Signalling Based on Trigger Blocks Seccond inputs +input bool eaSecondsTriggersSLUsingFirstTriggerBlock = true; // Use First Trigger Block for SL of Seconds Trigger Block Signalss +input bool eaApplyValidateAndFilterOnSelectInsideOthers = false; // Select Trigger Blocks by Applying Validations and Filterss +input bool eaAllowSignallingConditions1 = true; // Allow Market Conditions Signaller to Using Sar Signals +input bool eaAllowSignallingConditions2 = true; // Allow Market Conditions Signaller to Using Trend Signals +input bool eaAllowSignallingConditions3 = true; // Allow Market Conditions Signaller to Using Delta Signals +input bool eaAllowSignallingConditions4 = true; // Allow Market Conditions Signaller to Using Volume Signals +input bool eaAllowSignallingConditions5 = true; // Allow Market Conditions Signaller to Using Signal Bar Signals +input bool eaAllowSignallingConditions6 = true; // Allow Market Conditions Signaller to Using HK Signal Bar Signals // // Volume ... @@ -165,11 +165,11 @@ input bool eaReportAfterTradesBalance = true; // Report Balance after a Trade Fi // // Collector ... input group "Collector"; -input bool eaSaveTrades = false; // Save Trades -input bool eaSaveSignals = false; // Save Signals -input bool eaSaveWins = false; // Save Winning Conditions -input bool eaSaveLosts = false; // Save Lost Conditions -input bool eaSaveRestrictions = false; // Save Restriction Reports +input bool eaSaveTrades = true; // Save Trades +input bool eaSaveSignals = true; // Save Signals +input bool eaSaveWins = true; // Save Winning Conditions +input bool eaSaveLosts = true; // Save Lost Conditions +input bool eaSaveRestrictions = true; // Save Restriction Reports // // Variables ... diff --git a/XCATBEA/Libraries/xcatbea.signaller.lib.mq5 b/XCATBEA/Libraries/xcatbea.signaller.lib.mq5 index 6792e6b7..9f164a80 100644 --- a/XCATBEA/Libraries/xcatbea.signaller.lib.mq5 +++ b/XCATBEA/Libraries/xcatbea.signaller.lib.mq5 @@ -422,6 +422,8 @@ bool DetectSignalZone( datetime iTo = NULL; string iSymbol = NULL; datetime iFrom = NULL; + int longPushers = 0; + int shortPushers = 0; ENUM_TIMEFRAMES iPeriod = NULL; ENUM_X_DIRECTION iDir = X_DIRECTION_NONE; @@ -965,6 +967,16 @@ bool DetectSignalZone( iUpper = signalZone.upper; iLower = signalZone.lower; } + + // + if (isCond1Bullish) + { + longPushers++; + } + else + { + shortPushers++; + } } // ---------------------------------- @@ -1026,6 +1038,16 @@ bool DetectSignalZone( iUpper = signalZone.upper; iLower = signalZone.lower; } + + // + if (isCond2Bullish) + { + longPushers++; + } + else + { + shortPushers++; + } } // ------------------------------------ @@ -1087,6 +1109,16 @@ bool DetectSignalZone( iUpper = signalZone.upper; iLower = signalZone.lower; } + + // + if (isCond3Bullish) + { + longPushers++; + } + else + { + shortPushers++; + } } // ------------------------------------ @@ -1148,6 +1180,16 @@ bool DetectSignalZone( iUpper = signalZone.upper; iLower = signalZone.lower; } + + // + if (isCond4Bullish) + { + longPushers++; + } + else + { + shortPushers++; + } } // ------------------------------------ @@ -1209,6 +1251,16 @@ bool DetectSignalZone( iUpper = signalZone.upper; iLower = signalZone.lower; } + + // + if (isCond5Bullish) + { + longPushers++; + } + else + { + shortPushers++; + } } // ------------------------------------ @@ -1270,6 +1322,16 @@ bool DetectSignalZone( iUpper = signalZone.upper; iLower = signalZone.lower; } + + // + if (isCond6Bullish) + { + longPushers++; + } + else + { + shortPushers++; + } } // ------------------------------------ @@ -1304,8 +1366,10 @@ bool DetectSignalZone( // // Summarize Result ... result = - isBullish || - isBearish; + (isBullish && + longPushers >= 3) || + (isBearish && + shortPushers >= 3); // // Preparing Signal Zone ... @@ -1379,12 +1443,14 @@ bool DetectSignalZone( // Print("Conditions ..."); - // signalZone.Clean(); + signalZone.Clean(); } // // Validate Result ... - result = signalZone.IsValid(); + result = + result && + signalZone.IsValid(); // // Cleanup Resources ...