diff --git a/Classes/x-saherelm.x121.provider.class.mq5 b/Classes/x-saherelm.x121.provider.class.mq5 index 0f5fa3f6..01fa0b98 100644 --- a/Classes/x-saherelm.x121.provider.class.mq5 +++ b/Classes/x-saherelm.x121.provider.class.mq5 @@ -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; } diff --git a/Classes/x-saherelm.x121.xmcycle.class.mq5 b/Classes/x-saherelm.x121.xmcycle.class.mq5 index 8f736bff..aaa77519 100644 --- a/Classes/x-saherelm.x121.xmcycle.class.mq5 +++ b/Classes/x-saherelm.x121.xmcycle.class.mq5 @@ -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( diff --git a/Classes/x-saherelm.xea.class.mq5 b/Classes/x-saherelm.xea.class.mq5 index 006c889e..d85c6ece 100644 --- a/Classes/x-saherelm.xea.class.mq5 +++ b/Classes/x-saherelm.xea.class.mq5 @@ -3262,6 +3262,16 @@ protected: return; } + // + XPosition positions[]; + int positionsCount = mTrader.GetPositions(positions); + if (!IsValidSize(positionsCount)) + { + // + Clean(mProfitTracks); + return; + } + // lastProfitTracked = cTime; diff --git a/Experts/x-test.x121ea.mq5 b/Experts/x-test.x121ea.mq5 index f44c5f51..5b970d5a 100644 --- a/Experts/x-test.x121ea.mq5 +++ b/Experts/x-test.x121ea.mq5 @@ -195,8 +195,8 @@ bool InitialEA() // // Define Signallers ... ENUM_X121_SIGNAL_PROVIDERS signallers[]; - Add(X786, signallers); - // Add(X110, signallers); + // Add(X786, signallers); + Add(X121, signallers); // Add(X121, signallers); // Add(X128, signallers); // Add(X92, signallers); @@ -259,6 +259,9 @@ bool InitialEA() // ConfigureDescriptor(iDescriptor); + // + ApplyPreDefineConfigurations(iDescriptor); + // // Init Inputs ... result = iDescriptor.inputs.Init(); @@ -307,7 +310,7 @@ void ConfigureDescriptor( // // XHK ... iDescriptor.inputs.hkInputs.drawHikenAshi = false; - iDescriptor.inputs.hkInputs.drawSmoothedHikenAshi = true; + iDescriptor.inputs.hkInputs.drawSmoothedHikenAshi = false; // // XMRB ... @@ -324,8 +327,8 @@ void ConfigureDescriptor( // // XICH ... iDescriptor.inputs.ichInputs.showKumo = false; - iDescriptor.inputs.ichInputs.showKijunSen = true; - iDescriptor.inputs.ichInputs.showTenkanSen = true; + iDescriptor.inputs.ichInputs.showKijunSen = false; + iDescriptor.inputs.ichInputs.showTenkanSen = false; iDescriptor.inputs.ichInputs.showChikouSpan = false; iDescriptor.inputs.ichInputs.showSenkouSpanA = false; iDescriptor.inputs.ichInputs.showSenkouSpanB = false; @@ -341,30 +344,30 @@ void ConfigureDescriptor( // // XPV ... - iDescriptor.inputs.pvInputs.showPeaksAndVales = true; + iDescriptor.inputs.pvInputs.showPeaksAndVales = false; iDescriptor.inputs.pvInputs.showLevels = false; iDescriptor.inputs.pvInputs.showConsolidations = false; - iDescriptor.inputs.pvInputs.showFibo1Levels = true; - iDescriptor.inputs.pvInputs.showFibo2Levels = true; - iDescriptor.inputs.pvInputs.showFibo3Levels = true; - iDescriptor.inputs.pvInputs.showFibo4Levels = true; - iDescriptor.inputs.pvInputs.showFibo5Levels = true; + iDescriptor.inputs.pvInputs.showFibo1Levels = false; + iDescriptor.inputs.pvInputs.showFibo2Levels = false; + iDescriptor.inputs.pvInputs.showFibo3Levels = false; + iDescriptor.inputs.pvInputs.showFibo4Levels = false; + iDescriptor.inputs.pvInputs.showFibo5Levels = false; // // XZG ... - iDescriptor.inputs.zgInputs.showZigZag = true; - iDescriptor.inputs.zgInputs.showPeaksAndVales = true; + iDescriptor.inputs.zgInputs.showZigZag = false; + iDescriptor.inputs.zgInputs.showPeaksAndVales = false; // // XDON ... iDescriptor.inputs.donInputs.showOpen = false; - iDescriptor.inputs.donInputs.showHigh = true; + iDescriptor.inputs.donInputs.showHigh = false; iDescriptor.inputs.donInputs.showClose = false; iDescriptor.inputs.donInputs.showLow = false; // // XSTR ... - iDescriptor.inputs.strInputs.showTrends = true; + iDescriptor.inputs.strInputs.showTrends = false; iDescriptor.inputs.strInputs.fillTrends = false; // @@ -972,4 +975,37 @@ void ConfigureMarketDrawSpecs( } } +// +void ApplyPreDefineConfigurations(X121ProviderDescriptor &iDescriptor) +{ + // + bool isX786 = false; + bool isX121 = true; + + // + if (isX786) + { + } + + // + if (isX121) + { + // + iDescriptor.inputs.mrbInputs.showFastMa = isX121; + iDescriptor.inputs.mrbInputs.showSlowMa = isX121; + iDescriptor.inputs.mrbInputs.showRibbon = isX121 && false; + + // + iDescriptor.inputs.mcInputs.showFastMa = isX121; + iDescriptor.inputs.mcInputs.showSlowMa = isX121; + iDescriptor.inputs.mcInputs.showVerifierMa = isX121; + + // + iDescriptor.inputs.cheInputs.showLongExit1Line = isX121; + iDescriptor.inputs.cheInputs.showShortExit1Line = isX121; + iDescriptor.inputs.cheInputs.showLongExit2Line = isX121; + iDescriptor.inputs.cheInputs.showShortExit2Line = isX121; + } +} + // \ No newline at end of file diff --git a/Helpers/x-saherelm.xmc.helper.mq5 b/Helpers/x-saherelm.xmc.helper.mq5 index 0ec6a851..af386a3e 100644 --- a/Helpers/x-saherelm.xmc.helper.mq5 +++ b/Helpers/x-saherelm.xmc.helper.mq5 @@ -456,7 +456,6 @@ private: { // int totalBars = CountBars(); - int calculatedBars = CountCalculatedBars(); // // Fast ... diff --git a/Indicators/x-saherelm.xlh.mq5 b/Indicators/x-saherelm.xlh.mq5 index 16858c25..e06de55a 100644 --- a/Indicators/x-saherelm.xlh.mq5 +++ b/Indicators/x-saherelm.xlh.mq5 @@ -61,7 +61,7 @@ double hhBuffer[]; // #property indicator_label1 "XLH HH" #property indicator_type1 DRAW_LINE -#property indicator_color1 clrAqua +#property indicator_color1 CLR_NONE, // clrAqua #property indicator_style1 STYLE_DOT #property indicator_width1 1 @@ -75,7 +75,7 @@ double llBuffer[]; // #property indicator_label2 "XLH LL" #property indicator_type2 DRAW_LINE -#property indicator_color2 clrFuchsia +#property indicator_color2 CLR_NONE, // clrFuchsia #property indicator_style2 STYLE_DOT #property indicator_width2 1 @@ -89,7 +89,7 @@ double signalBuffer[]; // #property indicator_label3 "XLH S" #property indicator_type3 DRAW_LINE -#property indicator_color3 clrGold +#property indicator_color3 CLR_NONE, // clrGold #property indicator_style3 STYLE_DOT #property indicator_width3 1 // diff --git a/Libraries/x-saherelm.common.lib.mq5 b/Libraries/x-saherelm.common.lib.mq5 index 4968d755..e2bd85a6 100644 --- a/Libraries/x-saherelm.common.lib.mq5 +++ b/Libraries/x-saherelm.common.lib.mq5 @@ -1463,6 +1463,29 @@ struct XOHCL return result; } + // + // Candlestic Tools ... + + // + bool IsDoji() { + // + bool result = false; + + // + // Validate Content and Ignore 0 Bar + // since it is not Completed ... + result = IsValid() && Index() > 0; + if (!result) { + return result; + } + + // + result = open == close; + + // + return result; + } + // // Convert to String Representation ... string ToString()