This commit is contained in:
2024-09-22 09:04:51 +03:30
parent ea24ea84d9
commit 65385c20ab
2 changed files with 40 additions and 2 deletions
@@ -22,6 +22,7 @@
//
// Imports ...
#include "../Classes/x-saherelm.xtrade.class.mq5"
#include "../Helpers/x-saherelm.xchvwap.helper.mq5"
//
// Definitions ...
@@ -1284,6 +1285,25 @@ class X121SCTradeHandler : public XSCBaseAlert
mSupportStartDistance = value;
}
//
int MaxAllowedSupport()
{
return mMaxAllowedSupport;
}
//
void MaxAllowedSupport(int value)
{
//
if (value < 0)
{
value = 0;
}
//
mMaxAllowedSupport = value;
}
//
double SupportVolumeMultiplier()
{
@@ -2640,16 +2660,24 @@ class X121SCTradeHandler : public XSCBaseAlert
// Reading Requirement for Support Positions ...
bool allowSupport = AllowSupport();
double supportStartDistance = SupportStartDistance();
int maxAllowedSupport = MaxAllowedSupport();
int delayBetweenTwoSupport = DelayBetweenTwoSupport();
double supportVolumeMultiplier = SupportVolumeMultiplier();
bool multiplySupportLevelOnVolume = MultiplySupportLevelOnVolume();
bool doSupportOnConditions = DoSupportOnConditions();
bool canSupport = (!isInProfit ||
bool canSupport = allowSupport &&
(!isInProfit ||
(isInProfit && supportsCount > 0)) &&
maxAllowedSupport >= 0 &&
supportStartDistance >= 0 &&
supportVolumeMultiplier > 0 &&
MathAbs(profitInPoint) >= supportStartDistance &&
//
// Check Max Allowed Support ...
(maxAllowedSupport == 0
? true
: supportsCount < maxAllowedSupport) &&
//
// Check Delay ...
(!IsValid(mData[iDX].lastSupportedOn)
? true
@@ -3226,6 +3254,7 @@ class X121SCTradeHandler : public XSCBaseAlert
// Support ...
bool mAllowSupport; // Allow Support
double mSupportStartDistance; // Specify Start Support Drawdown in Point
int mMaxAllowedSupport; // Max Allowed Number of Support Position
double mSupportVolumeMultiplier; // Specify Support Volume Multiplier
bool mMultiplySupportLevelOnVolume; // Multiply Support Level on Volume Multiplier
bool mDoSupportOnConditions; // Do Support on Conditions
@@ -3452,6 +3481,13 @@ class X121SCTradeHandler : public XSCBaseAlert
mCollector.SaveSignal(item);
}
//
// Install all Helpers and Prepare all
// Configurations for required Indicators ...
void PrepareRequirements()
{
}
//
};