This commit is contained in:
2024-06-24 11:58:37 +03:30
parent d5658a8e27
commit 3acd8d355f
2 changed files with 71 additions and 37 deletions
+68 -34
View File
@@ -3732,14 +3732,14 @@ public:
mConditions, mConditions,
otherConditions // otherConditions //
); );
AddRef( // AddRef(
lConditions, // lConditions,
otherConditions // // otherConditions //
); // );
AddRef( // AddRef(
hConditions, // hConditions,
otherConditions // // otherConditions //
); // );
} }
// //
@@ -3757,14 +3757,14 @@ public:
mConditions, mConditions,
otherConditions // otherConditions //
); );
AddRef( // AddRef(
lConditions, // lConditions,
otherConditions // // otherConditions //
); // );
AddRef( // AddRef(
hConditions, // hConditions,
otherConditions // // otherConditions //
); // );
} }
// //
@@ -3775,11 +3775,11 @@ public:
// //
AddRef( AddRef(
cConditions, sConditions,
otherConditions // otherConditions //
); );
AddRef( AddRef(
sConditions, lConditions,
otherConditions // otherConditions //
); );
} }
@@ -3791,18 +3791,18 @@ public:
signal = lSignal; signal = lSignal;
// //
AddRef( // AddRef(
cConditions, // cConditions,
otherConditions // // otherConditions //
); // );
AddRef(
sConditions,
otherConditions //
);
AddRef( AddRef(
mConditions, mConditions,
otherConditions // otherConditions //
); );
AddRef(
hConditions,
otherConditions //
);
} }
// //
@@ -3820,6 +3820,18 @@ public:
sConditions, sConditions,
otherConditions // otherConditions //
); );
AddRef(
mConditions,
otherConditions //
);
AddRef(
lConditions,
otherConditions //
);
AddRef(
hConditions,
otherConditions //
);
} }
// //
@@ -5012,26 +5024,48 @@ private:
int setupIDX = FindSetupIndex(positions[maxInDIDX].symbol); int setupIDX = FindSetupIndex(positions[maxInDIDX].symbol);
if (IsValidIndex(maxInDIDX) && IsValidIndex(setupIDX)) if (IsValidIndex(maxInDIDX) && IsValidIndex(setupIDX))
{ {
//
string iSymbol = positions[maxInDIDX].symbol;
ENUM_TIMEFRAMES iPeriod = mSetups[setupIDX].GetPeriod();
// //
// Check Position Age ... // Check Position Age ...
int age = GetAge( int age = GetAge(
positions[maxInDIDX], positions[maxInDIDX],
mSetups[setupIDX].GetPeriod() // iPeriod //
); );
if (age >= 700) if (age >= 700)
{ {
// //
string comment = XEQMSupportToken + " Close Max In D ..."; // Calculate Trend ...
bool isClosed = mTrader.Close( XSCTrend *trend = new XSCTrend(
positions[maxInDIDX].ticket, iSymbol,
comment // iPeriod //
); );
if (isClosed)
//
XSCTrendInput tInputs;
tInputs.Default();
bool canUseTrend = trend.Init(tInputs);
if (canUseTrend)
{ {
// //
string message = XEQMSupportToken + " Close Position (" + ToString(positions[maxInDIDX].ticket) + ") Due Max In Drawdown ..."; trend.Draw();
Alert(message); Print("UseTrend");
trend.Remove();
} }
// string comment = XEQMSupportToken + " Close Max In D ...";
// bool isClosed = mTrader.Close(
// positions[maxInDIDX].ticket,
// comment //
// );
// if (isClosed)
// {
// //
// string message = XEQMSupportToken + " Close Position (" + ToString(positions[maxInDIDX].ticket) + ") Due Max In Drawdown ...";
// Alert(message);
// }
} }
} }
} }
+3 -3
View File
@@ -74,7 +74,7 @@ input bool x121EACloseOnOpposit = false; // Close all Positions on Opposit
// //
input group "Trailling"; input group "Trailling";
input bool x121EAAllowTrailStop = false; // Enable Trailling Stop Losses input bool x121EAAllowTrailStop = true; // Enable Trailling Stop Losses
input bool x121EADisableTrailingWhenOpposit = true; // Disable Trailling When has Opposite In Drawdown input bool x121EADisableTrailingWhenOpposit = true; // Disable Trailling When has Opposite In Drawdown
input double x121EAFirstTrailDistance = 100; // Start Trailling Distance input double x121EAFirstTrailDistance = 100; // Start Trailling Distance
input double x121EAFirstTrailPoint = 60; // First Stop Trail input double x121EAFirstTrailPoint = 60; // First Stop Trail
@@ -110,14 +110,14 @@ input double x121EAMaxAllowedRecoveryVolume = 0.08; // Max Allowed Recovery Sign
// //
input group "Hedging"; input group "Hedging";
input int x121EARestingAfterHedge = 0; // Resting Seconds After Hedge input int x121EARestingAfterHedge = 3000; // Resting Seconds After Hedge
input double x121EAForceCloseProfit = 15; // Close All Positions Regardless of Policies when Profit Reached input double x121EAForceCloseProfit = 15; // Close All Positions Regardless of Policies when Profit Reached
input double x121EAMaxDrawdownForce = 5; // Max Drawdown Force State for Handling Guards input double x121EAMaxDrawdownForce = 5; // Max Drawdown Force State for Handling Guards
input int x121EAMaxPositionsForce = 10; // Max Number of Positions Force State for Handling Guards input int x121EAMaxPositionsForce = 10; // Max Number of Positions Force State for Handling Guards
input double x121EAMinFreeMargingForHandleForce = 800; // Min Free Margin for Force States input double x121EAMinFreeMargingForHandleForce = 800; // Min Free Margin for Force States
input double x121EAForceCloseOnEuityDiff = 15; // Force Close On Equity Differential input double x121EAForceCloseOnEuityDiff = 15; // Force Close On Equity Differential
input bool x121EAAllowSymbolHedgeOnForce = false; // Allow Symbol Hedging on Force States input bool x121EAAllowSymbolHedgeOnForce = false; // Allow Symbol Hedging on Force States
input double x121EAMinRequiredProfitPerTrade = 0.5; // Minimum Required Profit for Hedging input double x121EAMinRequiredProfitPerTrade = 0.2; // Minimum Required Profit for Hedging
input double x121EAMinRequiredProfitPerVolumeFactor = 0.01; // Minimum Required Profit for Hedging Per Volume input double x121EAMinRequiredProfitPerVolumeFactor = 0.01; // Minimum Required Profit for Hedging Per Volume
// //