This commit is contained in:
2025-05-07 23:53:37 +03:30
parent 32f895407f
commit 2ba019e1f0
5 changed files with 746 additions and 49 deletions
+58 -6
View File
@@ -952,6 +952,32 @@ struct XPosition
}
}
//
// Calculate Touched Reward ...
double CalculateTouchedReward()
{
//
double result = 0.0;
//
bool has = IsValid() &&
profit > 0;
if (!has)
{
return result;
}
//
double risk = MathAbs(entry - sl);
double currentReward = MathAbs(price - entry);
//
result = currentReward / risk;
//
return result;
}
//
// Calculate Age ...
int GetAge(
@@ -1111,6 +1137,7 @@ struct XSignal
//
// TP ...
double fullTPLevel; // Full TP ...
bool isPartiallyClosed; // Check Partially Closed Before or not ...
double partialCloseMultiplier; // Amount of Partial Close ...
double partialCloseOnTPLevel; // Do Partial Close on TP Level ...
@@ -1121,10 +1148,10 @@ struct XSignal
//
// Traget ...
double targets[]; // Force Risk Free On Targets ...
double targets[]; // Force Risk Free On Targets ...
bool isTargetApplied; // Target Applied ...
int appliedTargetIDX; // Last Applied Target Index ...
bool ignoreEAVolume; // Ignore EA Volume ...
bool ignoreEAVolume; // Ignore EA Volume ...
//
// SL Trail ...
@@ -1697,6 +1724,7 @@ struct XSignal
fullTPLevel = 0;
tpLevelForBreakEven = 0;
partialCloseOnTPLevel = 0;
isPartiallyClosed = false;
partialCloseMultiplier = 0;
trailSLStartOnReachTPLevel = 0;
@@ -1709,7 +1737,8 @@ struct XSignal
//
// Default Values ...
void Default() {
void Default()
{
//
entry = 0;
volume = 0;
@@ -1739,6 +1768,7 @@ struct XSignal
//
fullTPLevel = 0;
tpLevelForBreakEven = 0;
isPartiallyClosed = false;
partialCloseOnTPLevel = 0;
partialCloseMultiplier = 0;
trailSLStartOnReachTPLevel = 0;
@@ -2029,12 +2059,13 @@ struct XSignal
}
//
bool IsSameAs(XSignal &item) {
bool IsSameAs(XSignal &item)
{
//
bool result = false;
//
result =
result =
//
IsValid() &&
item.IsValid() &&
@@ -2054,6 +2085,28 @@ struct XSignal
//
return result;
}
//
string GetMessage()
{
//
string result = NULL;
//
if (!IsValid())
{
return result;
}
//
result = ToString(type) +
" Signal Provided by: " + provider +
" on (" + symbol + ")" +
" in: " + ToString(period);
//
return result;
}
};
//
@@ -5239,7 +5292,6 @@ bool IsStateFilterPassed(
//
//
//
// Calculate Positions Profit Summary ...