This commit is contained in:
2024-07-30 19:43:09 +03:30
parent 7a98bbe094
commit aadcf4f647
3 changed files with 284 additions and 263 deletions
+223
View File
@@ -413,6 +413,229 @@ public:
mDrawImportantAreas = value; mDrawImportantAreas = value;
} }
//
// Important Areas Getters ...
//
bool GetSupport(
XOHCL &bar //
)
{
//
bool result = false;
//
bar.Clean();
//
result = support.IsValid();
if (result)
{
bar = support;
}
//
return result;
}
//
bool GetResistance(
XOHCL &bar //
)
{
//
bool result = false;
//
bar.Clean();
//
result = resistance.IsValid();
if (result)
{
bar = resistance;
}
//
return result;
}
//
bool GetBullishOB(
XOHCL &bar //
)
{
//
bool result = false;
//
bar.Clean();
//
result = bullishOB.IsValid();
if (result)
{
bar = bullishOB;
}
//
return result;
}
//
bool GetBearishOB(
XOHCL &bar //
)
{
//
bool result = false;
//
bar.Clean();
//
result = bearishOB.IsValid();
if (result)
{
bar = bearishOB;
}
//
return result;
}
//
bool GetBullishFVG(
XOHCL &bar,
double upper,
double lower //
)
{
//
bool result = false;
//
upper = 0;
lower = 0;
bar.Clean();
//
result = bullishFVG.IsValid();
if (result)
{
//
bar = bullishFVG;
upper = bullishFVGUpper;
lower = bullishFVGLower;
}
//
return result;
}
//
bool GetBearishFVG(
XOHCL &bar,
double upper,
double lower //
)
{
//
bool result = false;
//
upper = 0;
lower = 0;
bar.Clean();
//
result = bearishFVG.IsValid();
if (result)
{
//
bar = bearishFVG;
upper = bearishFVGUpper;
lower = bearishFVGLower;
}
//
return result;
}
//
bool GetBullishTrend(
XOHCL &bar,
XOHCL &swingHighs[],
XOHCL &swingLows[] //
)
{
//
bool result = false;
//
bar.Clean();
Clean(swingHighs);
Clean(swingLows);
//
result = bullishTrend.IsValid();
if (result)
{
//
bar = bullishTrend;
//
Copy(
bullishTrendSwingHighs,
swingHighs //
);
Copy(
bullishTrendSwingLows,
swingLows //
);
}
//
return result;
}
//
bool GetBearishTrend(
XOHCL &bar,
XOHCL &swingHighs[],
XOHCL &swingLows[] //
)
{
//
bool result = false;
//
bar.Clean();
Clean(swingHighs);
Clean(swingLows);
//
result = bearishTrend.IsValid();
if (result)
{
//
bar = bearishTrend;
//
Copy(
bearishTrendSwingHighs,
swingHighs //
);
Copy(
bearishTrendSwingLows,
swingLows //
);
}
//
return result;
}
// //
// Virtual Methods ... // Virtual Methods ...
+7 -7
View File
@@ -45,8 +45,8 @@ int eaMaxAllowedLongs = 1; // Max Allowed Long Positions
int eaMaxAllowedShorts = 1; // Max Allowed Short Positions int eaMaxAllowedShorts = 1; // Max Allowed Short Positions
// //
input double eaTPPoint = 100; // Static TP Point double eaTPPoint = 150; // Static TP Point
input double eaSLPoint = 100; // Static SL Point double eaSLPoint = 100; // Static SL Point
// //
bool eaIgnoreTP = false; // Ignore TP bool eaIgnoreTP = false; // Ignore TP
@@ -277,16 +277,16 @@ bool InitialEA()
// //
// Configure Trailing ... // Configure Trailing ...
eaTradeHandler.AllowTrailStops(false); eaTradeHandler.AllowTrailStops(false);
eaTradeHandler.TrailStepInPoint(10); eaTradeHandler.TrailStepInPoint(30);
eaTradeHandler.TrailStartInPoint(20); eaTradeHandler.TrailStartInPoint(100);
eaTradeHandler.IgnoreTPOnTrail(true); eaTradeHandler.IgnoreTPOnTrail(true);
eaTradeHandler.TrailBasedOnProfit(true); eaTradeHandler.TrailBasedOnProfit(true);
// //
// Configure Recovery ... // Configure Recovery ...
eaTradeHandler.AllowRecover(false); eaTradeHandler.AllowRecover(false);
eaTradeHandler.RecoveryTPPoint(50); eaTradeHandler.RecoveryTPPoint(300);
eaTradeHandler.MaxAllowedRecover(3); eaTradeHandler.MaxAllowedRecover(0);
eaTradeHandler.MaxAllowedRecoveryVolume(0.1); eaTradeHandler.MaxAllowedRecoveryVolume(0.1);
eaTradeHandler.RecoverySLPoint(200); eaTradeHandler.RecoverySLPoint(200);
eaTradeHandler.RecoveryVolumeMultiplier(2); eaTradeHandler.RecoveryVolumeMultiplier(2);
@@ -321,7 +321,7 @@ bool InitialEA()
xchmStrategy.EnableXCHM(true); xchmStrategy.EnableXCHM(true);
xchmStrategy.EnableXCHHK(true); xchmStrategy.EnableXCHHK(true);
xchmStrategy.EnableXCHSTR(true); xchmStrategy.EnableXCHSTR(true);
xchmStrategy.EnableXCHCHE(true); xchmStrategy.EnableXCHCHE(false);
xchmStrategy.SetAlertLogAlerts(true); xchmStrategy.SetAlertLogAlerts(true);
xchmStrategy.DrawImportantAreas(false); xchmStrategy.DrawImportantAreas(false);
xchmStrategy.SetAlertEnableAlerts(true); xchmStrategy.SetAlertEnableAlerts(true);
+54 -256
View File
@@ -160,229 +160,6 @@ public:
mEnableXCHSTR = value; mEnableXCHSTR = value;
} }
//
// Important Areas Getters ...
//
bool GetSupport(
XOHCL &bar //
)
{
//
bool result = false;
//
bar.Clean();
//
result = support.IsValid();
if (result)
{
bar = support;
}
//
return result;
}
//
bool GetResistance(
XOHCL &bar //
)
{
//
bool result = false;
//
bar.Clean();
//
result = resistance.IsValid();
if (result)
{
bar = resistance;
}
//
return result;
}
//
bool GetBullishOB(
XOHCL &bar //
)
{
//
bool result = false;
//
bar.Clean();
//
result = bullishOB.IsValid();
if (result)
{
bar = bullishOB;
}
//
return result;
}
//
bool GetBearishOB(
XOHCL &bar //
)
{
//
bool result = false;
//
bar.Clean();
//
result = bearishOB.IsValid();
if (result)
{
bar = bearishOB;
}
//
return result;
}
//
bool GetBullishFVG(
XOHCL &bar,
double upper,
double lower //
)
{
//
bool result = false;
//
upper = 0;
lower = 0;
bar.Clean();
//
result = bullishFVG.IsValid();
if (result)
{
//
bar = bullishFVG;
upper = bullishFVGUpper;
lower = bullishFVGLower;
}
//
return result;
}
//
bool GetBearishFVG(
XOHCL &bar,
double upper,
double lower //
)
{
//
bool result = false;
//
upper = 0;
lower = 0;
bar.Clean();
//
result = bearishFVG.IsValid();
if (result)
{
//
bar = bearishFVG;
upper = bearishFVGUpper;
lower = bearishFVGLower;
}
//
return result;
}
//
bool GetBullishTrend(
XOHCL &bar,
XOHCL &swingHighs[],
XOHCL &swingLows[] //
)
{
//
bool result = false;
//
bar.Clean();
Clean(swingHighs);
Clean(swingLows);
//
result = bullishTrend.IsValid();
if (result)
{
//
bar = bullishTrend;
//
Copy(
bullishTrendSwingHighs,
swingHighs //
);
Copy(
bullishTrendSwingLows,
swingLows //
);
}
//
return result;
}
//
bool GetBearishTrend(
XOHCL &bar,
XOHCL &swingHighs[],
XOHCL &swingLows[] //
)
{
//
bool result = false;
//
bar.Clean();
Clean(swingHighs);
Clean(swingLows);
//
result = bearishTrend.IsValid();
if (result)
{
//
bar = bearishTrend;
//
Copy(
bearishTrendSwingHighs,
swingHighs //
);
Copy(
bearishTrendSwingLows,
swingLows //
);
}
//
return result;
}
// //
// Overrides ... // Overrides ...
@@ -885,7 +662,9 @@ public:
// //
hasBullishPower && hasBullishPower &&
cBar.IsBullish() && cBar.IsBullish() &&
cBar.low > chcheMinBullish &&
chcheConditions.isBullishPowerUp && chcheConditions.isBullishPowerUp &&
chcheConditions.isCStrongBearish &&
(chmConditions.hasBullishPower || (chmConditions.hasBullishPower ||
chhkConditions.hasBullishPower || chhkConditions.hasBullishPower ||
chstrConditions.hasBullishPower) chstrConditions.hasBullishPower)
@@ -921,7 +700,9 @@ public:
// //
hasBearishPower && hasBearishPower &&
cBar.IsBearish() && cBar.IsBearish() &&
cBar.high < chcheMaxBearish &&
chcheConditions.isBearishPowerUp && chcheConditions.isBearishPowerUp &&
chcheConditions.isCStrongBearish &&
(chmConditions.hasBearishPower || (chmConditions.hasBearishPower ||
chhkConditions.hasBearishPower || chhkConditions.hasBearishPower ||
chstrConditions.hasBearishPower) chstrConditions.hasBearishPower)
@@ -961,6 +742,23 @@ public:
return result; return result;
} }
//
result =
//
(hasLong &&
bullishTrend.IsValid())
//
||
//
(!hasLong &&
bearishTrend.IsValid())
//
;
if (!result)
{
return result;
}
// //
DestroyImportantAreas(); DestroyImportantAreas();
@@ -1106,7 +904,7 @@ private:
pvInputs.hcPeriod = hcPeriod; pvInputs.hcPeriod = hcPeriod;
// //
pvInputs.showPeaksAndVales = true; pvInputs.showPeaksAndVales = false;
pvInputs.showLevels = false; pvInputs.showLevels = false;
pvInputs.showConsolidations = false; pvInputs.showConsolidations = false;
pvInputs.showFibo1Levels = false; pvInputs.showFibo1Levels = false;
@@ -1140,8 +938,8 @@ private:
chmInputs.hcPeriod = hcPeriod; chmInputs.hcPeriod = hcPeriod;
// //
chmInputs.showFast = true; chmInputs.showFast = false;
chmInputs.showSlow = true; chmInputs.showSlow = false;
chmInputs.showCCFast = false; chmInputs.showCCFast = false;
chmInputs.showCCSlow = false; chmInputs.showCCSlow = false;
chmInputs.showSCFast = false; chmInputs.showSCFast = false;
@@ -1181,11 +979,11 @@ private:
chhkInputs.ignoreShadows = true; chhkInputs.ignoreShadows = true;
// //
chhkInputs.showCurrent = true; chhkInputs.showCurrent = false;
chhkInputs.showShort = true; chhkInputs.showShort = false;
chhkInputs.showMedium = true; chhkInputs.showMedium = false;
chhkInputs.showLong = true; chhkInputs.showLong = false;
chhkInputs.showHind = true; chhkInputs.showHind = false;
// //
chhkHelper = new XSCXCHHKHelper(); chhkHelper = new XSCXCHHKHelper();
@@ -1212,11 +1010,11 @@ private:
chstrInputs.hcPeriod = hcPeriod; chstrInputs.hcPeriod = hcPeriod;
// //
chstrInputs.showCurrent = true; chstrInputs.showCurrent = false;
chstrInputs.showShort = true; chstrInputs.showShort = false;
chstrInputs.showMedium = true; chstrInputs.showMedium = false;
chstrInputs.showLong = true; chstrInputs.showLong = false;
chstrInputs.showHind = true; chstrInputs.showHind = false;
// //
chstrHelper = new XSCXCHSTRHelper(); chstrHelper = new XSCXCHSTRHelper();
@@ -1233,26 +1031,26 @@ private:
chcheInputs.Default(); chcheInputs.Default();
// //
chcheInputs.showCurrentLE1 = true; chcheInputs.showCurrentLE1 = false;
chcheInputs.showCurrentLE2 = true; chcheInputs.showCurrentLE2 = false;
chcheInputs.showCurrentSE1 = true; chcheInputs.showCurrentSE1 = false;
chcheInputs.showCurrentSE2 = true; chcheInputs.showCurrentSE2 = false;
chcheInputs.showShortLE1 = true; chcheInputs.showShortLE1 = false;
chcheInputs.showShortLE2 = true; chcheInputs.showShortLE2 = false;
chcheInputs.showShortSE1 = true; chcheInputs.showShortSE1 = false;
chcheInputs.showShortSE2 = true; chcheInputs.showShortSE2 = false;
chcheInputs.showMediumLE1 = true; chcheInputs.showMediumLE1 = false;
chcheInputs.showMediumLE2 = true; chcheInputs.showMediumLE2 = false;
chcheInputs.showMediumSE1 = true; chcheInputs.showMediumSE1 = false;
chcheInputs.showMediumSE2 = true; chcheInputs.showMediumSE2 = false;
chcheInputs.showLongLE1 = true; chcheInputs.showLongLE1 = false;
chcheInputs.showLongLE2 = true; chcheInputs.showLongLE2 = false;
chcheInputs.showLongSE1 = true; chcheInputs.showLongSE1 = false;
chcheInputs.showLongSE2 = true; chcheInputs.showLongSE2 = false;
chcheInputs.showHindLE1 = true; chcheInputs.showHindLE1 = false;
chcheInputs.showHindLE2 = true; chcheInputs.showHindLE2 = false;
chcheInputs.showHindSE1 = true; chcheInputs.showHindSE1 = false;
chcheInputs.showHindSE2 = true; chcheInputs.showHindSE2 = false;
// //
chcheHelper = new XSCXCHCHEHelper(); chcheHelper = new XSCXCHCHEHelper();