This commit is contained in:
2024-06-29 00:59:01 +03:30
parent 767379c410
commit 7c0e44c4f6
2 changed files with 50 additions and 8 deletions
+48 -7
View File
@@ -4877,10 +4877,11 @@ protected:
// //
bool isMarginPassed = IsMarginPassed(); bool isMarginPassed = IsMarginPassed();
if (!isMarginPassed) bool isDrawdownPassed = IsDrawdownPassed();
if (!isDrawdownPassed)
{ {
// //
string message = "No Margin For Execute Signals ..."; string message = "Desn't Have Good State For Execute Signals ...";
// //
Alert(message); Alert(message);
@@ -4999,6 +5000,24 @@ protected:
return result; return result;
} }
//
bool IsDrawdownPassed() {
//
bool result = false;
//
double maxAllowedDrawdownPercent = 5; // MaxAllowedDrawdownPercent();
double drawdownPercent = GetDrawdownPercent();
//
result = maxAllowedDrawdownPercent <=0
? true
: drawdownPercent <= maxAllowedDrawdownPercent;
//
return result;
}
// //
// EQM Functions ... // EQM Functions ...
@@ -5125,16 +5144,15 @@ protected:
} }
// //
bool isForce = mSetups[setupIDX].ForceState(); // bool isForce = mSetups[setupIDX].ForceState();
if (!isForce) if (!mForce)
{ {
return; return;
} }
// //
// Check Delay Between Two Signals ... // TODO: Implement this later ...
bool isMarginPassed = IsMarginPassed(); return;
bool isDelayPassed = IsSignalDelayPassed(signal);
// //
XSignal signals[]; XSignal signals[];
@@ -5225,6 +5243,29 @@ protected:
{ {
return; return;
} }
//
// Exit From Force State ...
//
// One: Based On Positions Count ...
XPosition positions[];
int positionsCount = mTrader.GetPositions(positions);
if (!IsValidSize(positionsCount)) {
//
mForce = false;
return;
}
//
// Two: Based On Free Margin ...
bool isMarginPassed = IsMarginPassed();
bool isDrawdownPassed = IsDrawdownPassed();
if (isDrawdownPassed) {
//
mForce = false;
return;
}
// //
// Additional Works on Force States ... // Additional Works on Force States ...
+2 -1
View File
@@ -7,6 +7,7 @@
"settings": { "settings": {
"C_Cpp.default.includePath": [ "C_Cpp.default.includePath": [
"c:\\Users\\saherelm\\AppData\\Roaming\\MetaQuotes\\Terminal\\FAE4959D5A0334AE230243FCFFFD4053\\MQL5\\Include" "c:\\Users\\saherelm\\AppData\\Roaming\\MetaQuotes\\Terminal\\FAE4959D5A0334AE230243FCFFFD4053\\MQL5\\Include"
] ],
"C_Cpp.clang_format_style": "file:c:\\Users\\SaherElm\\.vscode\\extensions\\l-i-v.mql-tools-2.1.0\\files\\.clang-format"
} }
} }