This commit is contained in:
2024-09-20 18:17:31 +03:30
parent 46f8009ca5
commit ba1c5a73b7
2 changed files with 67 additions and 10 deletions
@@ -1237,6 +1237,18 @@ class X121SCTradeHandler : public XSCBaseAlert
mRecoveryMultiplier = value;
}
//
bool ApplyRecoveryLevelOnVolume()
{
return mApplyRecoveryLevelOnVolume;
}
//
void ApplyRecoveryLevelOnVolume(bool value)
{
mApplyRecoveryLevelOnVolume = value;
}
//
int RecoveryDelayInMinute()
{
@@ -2819,9 +2831,14 @@ class X121SCTradeHandler : public XSCBaseAlert
ENUM_X_ORDER_MODES mode = X_ORDER_MODE_MARKET;
double lastStep = mData[iDX].protectionStep;
double volume = position.volume * volumeMultiplier;
// supportsCount <= 0
// ? position.volume * volumeMultiplier
// : position.volume * ((supportsCount + 1) * volumeMultiplier);
bool applyLevel = ApplyRecoveryLevelOnVolume();
if (applyLevel)
{
//
volume = supportsCount <= 0
? position.volume *volumeMultiplier
: position.volume *((supportsCount + 1) * volumeMultiplier);
}
//
datetime currentTime = TimeCurrent();
@@ -2850,7 +2867,15 @@ class X121SCTradeHandler : public XSCBaseAlert
{
//
// Same Direction ...
canRecover = true;
canRecover =
//
isTicksBullishForLong &&
hasBullishTrend &&
(hasBullishPower ||
hasBullishPattern ||
hasBullishPressure)
//
;
if (canRecover)
{
//
@@ -2865,7 +2890,15 @@ class X121SCTradeHandler : public XSCBaseAlert
{
//
// Same Direction ...
canRecover = true;
canRecover =
//
isTicksBearishForShort &&
hasBearishTrend &&
(hasBearishPower ||
hasBearishPattern ||
hasBearishPressure)
//
;
if (canRecover)
{
//
@@ -2994,9 +3027,14 @@ class X121SCTradeHandler : public XSCBaseAlert
ENUM_X_ORDER_MODES mode = X_ORDER_MODE_MARKET;
double lastStep = mData[iDX].protectionStep;
double volume = position.volume * volumeMultiplier;
// supportsCount <= 0
// ? position.volume * volumeMultiplier
// : position.volume * ((supportsCount + 1) * volumeMultiplier);
bool applyLevel = ApplyRecoveryLevelOnVolume();
if (applyLevel)
{
//
volume = supportsCount <= 0
? position.volume *volumeMultiplier
: position.volume *((supportsCount + 1) * volumeMultiplier);
}
//
datetime currentTime = TimeCurrent();
@@ -3028,7 +3066,15 @@ class X121SCTradeHandler : public XSCBaseAlert
{
//
// Opposit Direction ...
canRecover = true;
canRecover =
//
isTicksBearishForShort &&
hasBearishTrend &&
(hasBearishPower ||
hasBearishPattern ||
hasBearishPressure)
//
;
if (canRecover)
{
//
@@ -3043,7 +3089,15 @@ class X121SCTradeHandler : public XSCBaseAlert
{
//
// Opposit Direction ...
canRecover = true;
canRecover =
//
isTicksBullishForLong &&
hasBullishTrend &&
(hasBullishPower ||
hasBullishPattern ||
hasBullishPressure)
//
;
if (canRecover)
{
//
@@ -3192,6 +3246,7 @@ class X121SCTradeHandler : public XSCBaseAlert
// In Drawdown Positions Protecting ...
bool mAllowRecoverInDrawdowns; // Allow Recovery For In Drawdown Positions
double mRecoveryMultiplier; // Recovery Volume Multiplier
bool mApplyRecoveryLevelOnVolume; // Apply Recovery Level on Volume Calculation
int mRecoveryDelayInMinute; // Delay Between Two Recovery in Minutes
double mRecoveryDistanceInPoint; // Distance Between Two Recovery in Point
double mPartialCloseOnSpecificPointOfDrawdown; // Partial Close Position on Specific Points of Drawdown