Apply Fix on Strategy Parse and Filtering ...

This commit is contained in:
2024-09-15 17:34:37 +03:30
parent 7ab8046543
commit 6aa7388127
3 changed files with 38 additions and 36 deletions
+30 -36
View File
@@ -831,11 +831,24 @@ void OnSignalRecieved(
// Strategy and it's not related to Public // Strategy and it's not related to Public
// TradeHandler for Seperation of Concern issue, // TradeHandler for Seperation of Concern issue,
// we do this here ... // we do this here ...
XCHCHEStartegyConditionsParser parser; XCHStartegyConditionsParser chParser;
bool isFiltered = parser.IsFiltered( XCHCHEStartegyConditionsParser chcheParser;
signal,
conditions // //
); bool isXCHSignal = signal.provider == XCHStartegyToken;
bool isXCHCHESignal = signal.provider == XCHCHEStartegyToken;
bool isFiltered =
isXCHSignal
? chParser.IsFiltered(
signal,
conditions //
)
: isXCHCHESignal
? chcheParser.IsFiltered(
signal,
conditions //
)
: true;
if (isFiltered) if (isFiltered)
{ {
// //
@@ -843,33 +856,6 @@ void OnSignalRecieved(
return; return;
} }
// //
// // Here we Can Increase Signal Volume if
// // it is not force Filtered ...
// bool isForceFiltered = parser.IsFiltered(
// signal,
// conditions,
// true //
// );
// if (!isForceFiltered)
// {
// //
// // TODO:
// // Implement Strong Signals Conditions
// // Senarios ...
// forceSignalsCount++;
// //
// // Alert Froce Strong Signals
// // if Provided ...
// if (eaAlertStrongSignals)
// {
// //
// string msg = "Foce Strong " + (IsLong(signal.type) ? "Long" : "Short") + " Signal Recieved: (" + signal.provider + "," + signal.symbol + "," + ToString(signal.period) + ") ...";
// eaAlert.Alert(msg);
// }
// }
// //
// Attach Conditions Summary to Signal ... // Attach Conditions Summary to Signal ...
string conditionsSummary = conditions.GenerateSummary( string conditionsSummary = conditions.GenerateSummary(
@@ -880,10 +866,18 @@ void OnSignalRecieved(
); );
// //
signal.conditions = parser.GenerateSignalConditions( signal.conditions =
signal, isXCHSignal
conditions // ? chParser.GenerateSignalConditions(
); // conditionsSummary; signal,
conditions //
)
: isXCHCHESignal
? chcheParser.GenerateSignalConditions(
signal,
conditions //
)
: conditionsSummary;
// //
// Execute Signal Using Trade Handler ... // Execute Signal Using Trade Handler ...
@@ -643,6 +643,10 @@ public:
return result; return result;
} }
//
// Attach Strategy Lebel ...
signal.provider = XCHCHEStartegyToken;
// //
// Notify XCH Specified Signal Event Handlers ... // Notify XCH Specified Signal Event Handlers ...
NotifyOnXCHSignalEventHandlers( NotifyOnXCHSignalEventHandlers(
+4
View File
@@ -1312,6 +1312,10 @@ public:
return result; return result;
} }
//
// Attach Strategy Lebel ...
signal.provider = XCHStartegyToken;
// //
// Notify XCH Specified Signal Event Handlers ... // Notify XCH Specified Signal Event Handlers ...
NotifyOnXCHSignalEventHandlers( NotifyOnXCHSignalEventHandlers(