This commit is contained in:
2024-05-29 16:56:07 +03:30
parent 4f95fe5ce7
commit 108d85e6c2
7 changed files with 769 additions and 273 deletions
+53 -254
View File
@@ -3244,6 +3244,16 @@ public:
// Try to Find Support and Resistances if Configured ...
FindSupportAndResistances();
//
// TODO:
//
// Here We Have to Implement Trail Management for
// Spearate Providers ...
//
// And also Remove EA Trail Manage ment inside EA ...
//
return result;
}
@@ -4686,8 +4696,8 @@ private:
ArraySetAsSeries(mBearishScore, true);
//
string scoreMSG = "Scores: \nBullihs: " + ToString(bullishScore) + "\nBearish: " + ToString(bearishScore);
Comment(scoreMSG);
// string scoreMSG = "Scores: \nBullihs: " + ToString(bullishScore) + "\nBearish: " + ToString(bearishScore);
// Comment(scoreMSG);
}
//
@@ -7692,148 +7702,43 @@ private:
bool result = false;
//
// Current Market ...
bool isCMCLong =
//
(
//
(mConditions.cMarketConditions.isSlowOverVerifier &&
mConditions.cMarketConditions.isFastCrossedOverVerifier)
//
||
//
(mConditions.cMarketConditions.isFastOverVerifier &&
mConditions.cMarketConditions.isSlowCrossedOverVerifier)
//
)
//
&&
//
(mConditions.cMarketConditions.isCloseOverFast &&
mConditions.cMarketConditions.isCloseOverSlow &&
mConditions.cMarketConditions.isCloseOverVerifier)
//
;
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
//
// Short Market ...
bool isSMCLong =
//
(
//
(mConditions.sMarketConditions.isSlowOverVerifier &&
mConditions.sMarketConditions.isFastCrossedOverVerifier)
//
||
//
(mConditions.sMarketConditions.isFastOverVerifier &&
mConditions.sMarketConditions.isSlowCrossedOverVerifier)
//
)
//
&&
//
(mConditions.sMarketConditions.isCloseOverFast &&
mConditions.sMarketConditions.isCloseOverSlow &&
mConditions.sMarketConditions.isCloseOverVerifier)
//
;
bool hasCMarketConditions = cMarket.HasX121LongConditions();
//
// Medium Market ...
bool isMMCLong =
if (hasCMarketConditions)
{
//
(
//
(mConditions.mMarketConditions.isSlowOverVerifier &&
mConditions.mMarketConditions.isFastCrossedOverVerifier)
//
||
//
(mConditions.mMarketConditions.isFastOverVerifier &&
mConditions.mMarketConditions.isSlowCrossedOverVerifier)
//
)
//
&&
//
(mConditions.mMarketConditions.isCloseOverFast &&
mConditions.mMarketConditions.isCloseOverSlow &&
mConditions.mMarketConditions.isCloseOverVerifier)
//
;
XOHCL cBar = cMarket.GetBar(cIndex);
//
// Long Market ...
bool isLMCLong =
//
(
//
(mConditions.lMarketConditions.isSlowOverVerifier &&
mConditions.lMarketConditions.isFastCrossedOverVerifier)
//
||
//
(mConditions.lMarketConditions.isFastOverVerifier &&
mConditions.lMarketConditions.isSlowCrossedOverVerifier)
//
)
//
&&
//
(mConditions.lMarketConditions.isCloseOverFast &&
mConditions.lMarketConditions.isCloseOverSlow &&
mConditions.lMarketConditions.isCloseOverVerifier)
//
;
r2r = 1.5;
//
// Hind Market ...
bool isHMCLong =
//
(
//
(mConditions.hMarketConditions.isSlowOverVerifier &&
mConditions.hMarketConditions.isFastCrossedOverVerifier)
//
||
//
(mConditions.hMarketConditions.isFastOverVerifier &&
mConditions.hMarketConditions.isSlowCrossedOverVerifier)
//
)
//
&&
//
(mConditions.hMarketConditions.isCloseOverFast &&
mConditions.hMarketConditions.isCloseOverSlow &&
mConditions.hMarketConditions.isCloseOverVerifier)
//
;
sl = cMarket.mrb.GetSlow(cIndex);
// sl = cBar.FindLowest(
// 3,
// MODE_HIGH //
// );
}
//
result =
//
// isCMCLong
// //
// ||
// //
// isSMCLong
// //
// ||
// //
isMMCLong
//
||
//
isLMCLong
//
||
//
isHMCLong
hasCMarketConditions
//
;
//
if (result)
{
Print("Salam");
}
//
return result;
}
@@ -8845,148 +8750,42 @@ private:
bool result = false;
//
// Current Market ...
bool isCMCShort =
//
(
//
(mConditions.cMarketConditions.isSlowUnderVerifier &&
mConditions.cMarketConditions.isFastCrossedUnderVerifier)
//
||
//
(mConditions.cMarketConditions.isFastUnderVerifier &&
mConditions.cMarketConditions.isSlowCrossedUnderVerifier)
//
)
//
&&
//
(mConditions.cMarketConditions.isCloseUnderFast &&
mConditions.cMarketConditions.isCloseUnderSlow &&
mConditions.cMarketConditions.isCloseUnderVerifier)
//
;
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
//
// Short Market ...
bool isSMCShort =
//
(
//
(mConditions.sMarketConditions.isSlowUnderVerifier &&
mConditions.sMarketConditions.isFastCrossedUnderVerifier)
//
||
//
(mConditions.sMarketConditions.isFastUnderVerifier &&
mConditions.sMarketConditions.isSlowCrossedUnderVerifier)
//
)
//
&&
//
(mConditions.sMarketConditions.isCloseUnderFast &&
mConditions.sMarketConditions.isCloseUnderSlow &&
mConditions.sMarketConditions.isCloseUnderVerifier)
//
;
bool hasCMarketConditions = cMarket.HasX121ShortConditions();
//
// Medium Market ...
bool isMMCShort =
if (hasCMarketConditions)
{
//
(
//
(mConditions.mMarketConditions.isSlowUnderVerifier &&
mConditions.mMarketConditions.isFastCrossedUnderVerifier)
//
||
//
(mConditions.mMarketConditions.isFastUnderVerifier &&
mConditions.mMarketConditions.isSlowCrossedUnderVerifier)
//
)
//
&&
//
(mConditions.mMarketConditions.isCloseUnderFast &&
mConditions.mMarketConditions.isCloseUnderSlow &&
mConditions.mMarketConditions.isCloseUnderVerifier)
//
;
XOHCL cBar = cMarket.GetBar(cIndex);
//
// Long Market ...
bool isLMCShort =
//
(
//
(mConditions.lMarketConditions.isSlowUnderVerifier &&
mConditions.lMarketConditions.isFastCrossedUnderVerifier)
//
||
//
(mConditions.lMarketConditions.isFastUnderVerifier &&
mConditions.lMarketConditions.isSlowCrossedUnderVerifier)
//
)
//
&&
//
(mConditions.lMarketConditions.isCloseUnderFast &&
mConditions.lMarketConditions.isCloseUnderSlow &&
mConditions.lMarketConditions.isCloseUnderVerifier)
//
;
r2r = 1.5;
//
// Hind Market ...
bool isHMCShort =
//
(
//
(mConditions.hMarketConditions.isSlowUnderVerifier &&
mConditions.hMarketConditions.isFastCrossedUnderVerifier)
//
||
//
(mConditions.hMarketConditions.isFastUnderVerifier &&
mConditions.hMarketConditions.isSlowCrossedUnderVerifier)
//
)
//
&&
//
(mConditions.hMarketConditions.isCloseUnderFast &&
mConditions.hMarketConditions.isCloseUnderSlow &&
mConditions.hMarketConditions.isCloseUnderVerifier)
//
;
sl = cBar.FindHighest(
3,
MODE_HIGH //
);
}
//
result =
//
// isCMCShort
// //
// ||
// //
// isSMCShort
// //
// ||
//
isMMCShort
//
||
//
isLMCShort
//
||
//
isHMCShort
hasCMarketConditions
//
;
//
if (result)
{
Print("Salam");
}
//
return result;
}
+629
View File
@@ -5714,6 +5714,635 @@ public:
return result;
}
//
// X121 Long ...
bool HasX121LongConditions()
{
//
bool result = false;
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
//
XOHCL cBar = GetBar(cIndex);
XOHCL pBar = GetBar(pIndex);
//
// XSTR ...
//
ENUM_XSTR_TREND_STATES cStrState = str
.GetState(cIndex);
double cStrTrend = str.GetTrend(cIndex);
bool isCStrBullish = cStrState == X_STR_BULLISH;
bool isCStrBearish = cStrState == X_STR_BEARISH;
//
ENUM_XSTR_TREND_STATES pStrState = str
.GetState(pIndex);
double pStrTrend = str.GetTrend(pIndex);
bool isPStrBullish = pStrState == X_STR_BULLISH;
bool isPStrBearish = pStrState == X_STR_BEARISH;
//
bool isTrendBullish = isCStrBullish;
bool isTrendBearish = isCStrBearish;
//
bool isTrendSwitchedToBullish =
//
isCStrBullish &&
!isPStrBullish
//
;
//
bool isTrendSwitchedToBearish =
//
isCStrBearish &&
!isPStrBearish
//
;
//
// XCHE ...
//
double cCHELongExit1 = che.GetLongExit1(cIndex);
double cCHELongExit2 = che.GetLongExit2(cIndex);
//
double pCHELongExit1 = che.GetLongExit1(pIndex);
double pCHELongExit2 = che.GetLongExit2(pIndex);
//
double cCHEShortExit1 = che.GetShortExit1(cIndex);
double cCHEShortExit2 = che.GetShortExit2(cIndex);
//
double pCHEShortExit1 = che.GetShortExit1(pIndex);
double pCHEShortExit2 = che.GetShortExit2(pIndex);
//
bool CCHEHasLongExit1 = NotEmpty(cCHELongExit1);
bool CCHEHasLongExit2 = NotEmpty(cCHELongExit2);
//
bool CCHEHasShortExit1 = NotEmpty(cCHEShortExit1);
bool CCHEHasShortExit2 = NotEmpty(cCHEShortExit2);
//
bool PCHEHasLongExit1 = NotEmpty(pCHELongExit1);
bool PCHEHasLongExit2 = NotEmpty(pCHELongExit2);
//
bool PCHEHasShortExit1 = NotEmpty(pCHEShortExit1);
bool PCHEHasShortExit2 = NotEmpty(pCHEShortExit2);
//
bool isCCHEBullish =
//
CCHEHasLongExit1 &&
CCHEHasLongExit2
//
;
//
bool isCCHEBearish =
//
CCHEHasShortExit1 &&
CCHEHasShortExit2
//
;
//
bool isPCHEBullish =
//
PCHEHasLongExit1 &&
PCHEHasLongExit2
//
;
//
bool isPCHEBearish =
//
PCHEHasShortExit1 &&
PCHEHasShortExit2
//
;
//
bool isCHEBullish = isCCHEBullish;
bool isCHEBearish = isCCHEBearish;
bool isCHESwitchedToBullish =
//
isCCHEBullish &&
!isPCHEBullish
//
;
bool isCHESwitchedToBearish =
//
isCCHEBearish &&
!isPCHEBearish
//
;
//
// XMC ...
//
double cMCFast = mc.GetFast(cIndex);
double pMCFast = mc.GetFast(pIndex);
//
double cMCSlow = mc.GetSlow(cIndex);
double pMCSlow = mc.GetSlow(pIndex);
//
double cMCVerifier = mc.GetVerifier(cIndex);
double pMCVerifier = mc.GetVerifier(pIndex);
//
bool isCMCFastOverSlow = cMCFast > cMCSlow;
bool isPMCFastOverSlow = pMCFast > pMCSlow;
//
bool isCMCFastUnderSlow = cMCFast < cMCSlow;
bool isPMCFastUnderSlow = pMCFast < pMCSlow;
//
bool isCMCFastOverVerifier = cMCFast > cMCVerifier;
bool isPMCFastOverVerifier = pMCFast > pMCVerifier;
//
bool isCMCFastUnderVerifier = cMCFast < cMCVerifier;
bool isPMCFastUnderVerifier = pMCFast < pMCVerifier;
//
bool isCMCSlowOverVerifier = cMCSlow > cMCVerifier;
bool isPMCSlowOverVerifier = pMCSlow > pMCVerifier;
//
bool isCMCSlowUnderVerifier = cMCSlow < cMCVerifier;
bool isPMCSlowUnderVerifier = pMCSlow < pMCVerifier;
//
bool isMCFastOverSlow = isCMCFastOverSlow;
bool isMCFastUnderSlow = isCMCFastUnderSlow;
bool isMCFastOverVerifier = isCMCFastOverVerifier;
bool isMCFastUnderVerifier = isCMCFastUnderVerifier;
bool isMCSlowOverVerifier = isCMCSlowOverVerifier;
bool isMCSlowUnderVerifier = isCMCSlowUnderVerifier;
//
bool isMCFastCrossedOverSlow =
//
isCMCFastOverSlow &&
!isPMCFastOverSlow
//
;
bool isMCFastCrossedUnderSlow =
//
isCMCFastUnderSlow &&
!isPMCFastUnderSlow
//
;
//
bool isMCFastCrossedOverVerifier =
//
isCMCFastOverVerifier &&
!isPMCFastOverVerifier
//
;
bool isMCFastCrossedUnderVerifier =
//
isCMCFastUnderVerifier &&
!isPMCFastUnderVerifier
//
;
//
bool isMCSlowCrossedOverVerifier =
//
isCMCSlowOverVerifier &&
!isPMCSlowOverVerifier
//
;
bool isMCSlowCrossedUnderVerifier =
//
isCMCSlowUnderVerifier &&
!isPMCSlowUnderVerifier
//
;
//
// XMRB ...
//
double cMRBFast = mrb.GetFast(cIndex);
double pMRBFast = mrb.GetFast(pIndex);
//
double cMRBSlow = mrb.GetSlow(cIndex);
double pMRBSlow = mrb.GetSlow(pIndex);
//
bool isCMRBFastOverSlow = cMRBFast > cMRBSlow;
bool isPMRBFastOverSlow = pMRBFast > pMRBSlow;
//
bool isCMRBFastUnderSlow = cMRBFast < cMRBSlow;
bool isPMRBFastUnderSlow = pMRBFast < pMRBSlow;
//
bool isMRBFastOverSlow = isCMRBFastOverSlow;
bool isMRBFastUnderSlow = isCMRBFastUnderSlow;
//
bool isMRBFastCrossedOverSlow =
//
isCMRBFastOverSlow &&
!isPMRBFastOverSlow
//
;
bool isMRBFastCrossedUnderSlow =
//
isCMRBFastUnderSlow &&
!isPMRBFastUnderSlow
//
;
//
// Combine MRB and MC ...
//
bool isCMRBFastOverVerifier = cMRBFast > cMCVerifier;
bool isPMRBFastOverVerifier = pMRBFast > pMCVerifier;
//
bool isCMRBFastUnderVerifier = cMRBFast < cMCVerifier;
bool isPMRBFastUnderVerifier = pMRBFast < pMCVerifier;
//
bool isCMRBSlowOverVerifier = cMRBSlow > cMCVerifier;
bool isPMRBSlowOverVerifier = pMRBSlow > pMCVerifier;
//
bool isCMRBSlowUnderVerifier = cMRBSlow < cMCVerifier;
bool isPMRBSlowUnderVerifier = pMRBSlow < pMCVerifier;
//
bool isMRBFastOverVerifier = isCMRBFastOverVerifier;
bool isMRBFastUnderVerifier = isCMRBFastUnderVerifier;
//
bool isMRBFastCrossedtOverVerifier =
//
isCMRBFastOverVerifier &&
!isPMRBFastOverVerifier
//
;
//
bool isMRBFastCrossedUnderVerifier =
//
isCMRBFastUnderVerifier &&
!isPMRBFastUnderVerifier
//
;
//
bool isMRBSlowOverVerifier = isCMRBSlowOverVerifier;
bool isMRBSlowUnderVerifier = isCMRBSlowUnderVerifier;
//
bool isMRBSlowCrossedtOverVerifier =
//
isCMRBSlowOverVerifier &&
!isPMRBSlowOverVerifier
//
;
//
bool isMRBSlowCrossedUnderVerifier =
//
isCMRBSlowUnderVerifier &&
!isPMRBSlowUnderVerifier
//
;
//
result =
//
(isMRBFastCrossedOverSlow &&
(isCHEBullish &&
isTrendBullish &&
isMCFastOverSlow))
//
||
//
(isMRBSlowCrossedtOverVerifier &&
(isCHEBullish &&
isTrendBullish &&
isMCFastOverSlow &&
isMRBFastOverSlow))
//
||
//
(isCHESwitchedToBullish &&
(isTrendBullish &&
isMCFastOverSlow &&
isMRBFastOverSlow))
//
;
//
return result;
}
//
// X121 Short ...
bool HasX121ShortConditions()
{
//
bool result = false;
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
//
XOHCL cBar = GetBar(cIndex);
XOHCL pBar = GetBar(pIndex);
//
// XSTR ...
//
ENUM_XSTR_TREND_STATES cStrState = str
.GetState(cIndex);
double cStrTrend = str.GetTrend(cIndex);
bool isCStrBullish = cStrState == X_STR_BULLISH;
bool isCStrBearish = cStrState == X_STR_BEARISH;
//
ENUM_XSTR_TREND_STATES pStrState = str
.GetState(pIndex);
double pStrTrend = str.GetTrend(pIndex);
bool isPStrBullish = pStrState == X_STR_BULLISH;
bool isPStrBearish = pStrState == X_STR_BEARISH;
//
bool isTrendBullish = isCStrBullish;
bool isTrendBearish = isCStrBearish;
//
bool isTrendSwitchedToBullish =
//
isCStrBullish &&
!isPStrBullish
//
;
//
bool isTrendSwitchedToBearish =
//
isCStrBearish &&
!isPStrBearish
//
;
//
// XCHE ...
//
double cCHELongExit1 = che.GetLongExit1(cIndex);
double cCHELongExit2 = che.GetLongExit2(cIndex);
//
double pCHELongExit1 = che.GetLongExit1(pIndex);
double pCHELongExit2 = che.GetLongExit2(pIndex);
//
double cCHEShortExit1 = che.GetShortExit1(cIndex);
double cCHEShortExit2 = che.GetShortExit2(cIndex);
//
double pCHEShortExit1 = che.GetShortExit1(pIndex);
double pCHEShortExit2 = che.GetShortExit2(pIndex);
//
bool CCHEHasLongExit1 = NotEmpty(cCHELongExit1);
bool CCHEHasLongExit2 = NotEmpty(cCHELongExit2);
//
bool CCHEHasShortExit1 = NotEmpty(cCHEShortExit1);
bool CCHEHasShortExit2 = NotEmpty(cCHEShortExit2);
//
bool PCHEHasLongExit1 = NotEmpty(pCHELongExit1);
bool PCHEHasLongExit2 = NotEmpty(pCHELongExit2);
//
bool PCHEHasShortExit1 = NotEmpty(pCHEShortExit1);
bool PCHEHasShortExit2 = NotEmpty(pCHEShortExit2);
//
bool isCCHEBullish =
//
CCHEHasLongExit1 &&
CCHEHasLongExit2
//
;
//
bool isCCHEBearish =
//
CCHEHasShortExit1 &&
CCHEHasShortExit2
//
;
//
bool isPCHEBullish =
//
PCHEHasLongExit1 &&
PCHEHasLongExit2
//
;
//
bool isPCHEBearish =
//
PCHEHasShortExit1 &&
PCHEHasShortExit2
//
;
//
bool isCHEBullish = isCCHEBullish;
bool isCHEBearish = isCCHEBearish;
bool isCHESwitchedToBullish =
//
isCCHEBullish &&
!isPCHEBullish
//
;
bool isCHESwitchedToBearish =
//
isCCHEBearish &&
!isPCHEBearish
//
;
//
// XMC ...
//
double cMCFast = mc.GetFast(cIndex);
double pMCFast = mc.GetFast(pIndex);
//
double cMCSlow = mc.GetSlow(cIndex);
double pMCSlow = mc.GetSlow(pIndex);
//
double cMCVerifier = mc.GetVerifier(cIndex);
double pMCVerifier = mc.GetVerifier(pIndex);
//
bool isCMCFastOverSlow = cMCFast > cMCSlow;
bool isPMCFastOverSlow = pMCFast > pMCSlow;
//
bool isCMCFastUnderSlow = cMCFast < cMCSlow;
bool isPMCFastUnderSlow = pMCFast < pMCSlow;
//
bool isCMCFastOverVerifier = cMCFast > cMCVerifier;
bool isPMCFastOverVerifier = pMCFast > pMCVerifier;
//
bool isCMCFastUnderVerifier = cMCFast < cMCVerifier;
bool isPMCFastUnderVerifier = pMCFast < pMCVerifier;
//
bool isCMCSlowOverVerifier = cMCSlow > cMCVerifier;
bool isPMCSlowOverVerifier = pMCSlow > pMCVerifier;
//
bool isCMCSlowUnderVerifier = cMCSlow < cMCVerifier;
bool isPMCSlowUnderVerifier = pMCSlow < pMCVerifier;
//
bool isMCFastOverSlow = isCMCFastOverSlow;
bool isMCFastUnderSlow = isCMCFastUnderSlow;
bool isMCFastOverVerifier = isCMCFastOverVerifier;
bool isMCFastUnderVerifier = isCMCFastUnderVerifier;
bool isMCSlowOverVerifier = isCMCSlowOverVerifier;
bool isMCSlowUnderVerifier = isCMCSlowUnderVerifier;
//
bool isMCFastCrossedOverSlow =
//
isCMCFastOverSlow &&
!isPMCFastOverSlow
//
;
bool isMCFastCrossedUnderSlow =
//
isCMCFastUnderSlow &&
!isPMCFastUnderSlow
//
;
//
bool isMCFastCrossedOverVerifier =
//
isCMCFastOverVerifier &&
!isPMCFastOverVerifier
//
;
bool isMCFastCrossedUnderVerifier =
//
isCMCFastUnderVerifier &&
!isPMCFastUnderVerifier
//
;
//
bool isMCSlowCrossedOverVerifier =
//
isCMCSlowOverVerifier &&
!isPMCSlowOverVerifier
//
;
bool isMCSlowCrossedUnderVerifier =
//
isCMCSlowUnderVerifier &&
!isPMCSlowUnderVerifier
//
;
//
// XMRB ...
//
double cMRBFast = mrb.GetFast(cIndex);
double pMRBFast = mrb.GetFast(pIndex);
//
double cMRBSlow = mrb.GetSlow(cIndex);
double pMRBSlow = mrb.GetSlow(pIndex);
//
bool isCMRBFastOverSlow = cMRBFast > cMRBSlow;
bool isPMRBFastOverSlow = pMRBFast > pMRBSlow;
//
bool isCMRBFastUnderSlow = cMRBFast < cMRBSlow;
bool isPMRBFastUnderSlow = pMRBFast < pMRBSlow;
//
bool isMRBFastOverSlow = isCMRBFastOverSlow;
bool isMRBFastUnderSlow = isCMRBFastUnderSlow;
//
bool isMRBFastCrossedOverSlow =
//
isCMRBFastOverSlow &&
!isPMRBFastOverSlow
//
;
bool isMRBFastCrossedUnderSlow =
//
isCMRBFastUnderSlow &&
!isPMRBFastUnderSlow
//
;
//
result =
//
(isMRBFastCrossedUnderSlow &&
(isCHEBearish &&
isTrendBearish &&
isMCFastUnderSlow &&
isMCFastUnderVerifier))
//
;
//
return result;
}
//
//
// Initial Market Cycle ...
bool Init(
+10
View File
@@ -3262,6 +3262,16 @@ protected:
return;
}
//
XPosition positions[];
int positionsCount = mTrader.GetPositions(positions);
if (!IsValidSize(positionsCount))
{
//
Clean(mProfitTracks);
return;
}
//
lastProfitTracked = cTime;