From 5d12ff79583be6f48ab0bce2431bb821d5311d11 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Mon, 24 Jun 2024 21:46:41 +0330 Subject: [PATCH] last ... --- Classes/x-saherelm.x121.setup.class.mq5 | 30 +- Classes/x-saherelm.x121.setup.cycle.class.mq5 | 4 + Classes/x-saherelm.x121.setup.xea.mq5 | 178 ++- Classes/x-saherelm.xea.class.mq5 | 3 +- Documents/BKP/Templates/strategies.mq5 | 1387 +++++++++++++++++ Experts/x-saherelm.x121.ea.mq5 | 28 +- Helpers/x-saherelm.xmrb.helper.mq5 | 27 +- 7 files changed, 1608 insertions(+), 49 deletions(-) create mode 100644 Documents/BKP/Templates/strategies.mq5 diff --git a/Classes/x-saherelm.x121.setup.class.mq5 b/Classes/x-saherelm.x121.setup.class.mq5 index 55e4ce52..a4fcb7e9 100644 --- a/Classes/x-saherelm.x121.setup.class.mq5 +++ b/Classes/x-saherelm.x121.setup.class.mq5 @@ -1070,13 +1070,17 @@ struct X121SignalGenerator bool HasLongConditions( X121SetupConditions &conditions, // Conditions int &pusher, // Pushers - string &provider // Provider + string &provider, // Provider + double &tp, // Provided TP + double &sl // Provided SL ) { // bool result = false; // + tp = 0; + sl = 0; pusher = 0; // @@ -1669,8 +1673,6 @@ struct X121SignalGenerator result = // pusher >= 1 && - // !isOSCShortVerified && - // bullishScore > bearishScore * 2 && ( // long1 @@ -1764,13 +1766,17 @@ struct X121SignalGenerator bool HasShortConditions( X121SetupConditions &conditions, // Conditions int &pusher, // Pushers - string &provider // Provider + string &provider, // Provider + double &tp, // Provided TP + double &sl // Provided SL ) { // bool result = false; // + tp = 0; + sl = 0; pusher = 0; // @@ -2363,8 +2369,6 @@ struct X121SignalGenerator result = // pusher >= 1 && - // !isOSCLongVerified && - // bearishScore > bullishScore * 2 && ( // short1 @@ -2688,7 +2692,7 @@ struct X121SignalGenerator // bool IsConditionsValidForLong( X121SetupConditions &conditions, // Conditions - int verifications = 4 // Number of Verifications + int verifications = 2 // Number of Verifications ) { // @@ -2944,7 +2948,7 @@ struct X121SignalGenerator // bool IsConditionsValidForShort( X121SetupConditions &conditions, // Conditions - int verifications = 4 // Number of Verifications + int verifications = 2 // Number of Verifications ) { // @@ -3011,6 +3015,8 @@ struct X121SignalGenerator XSignal &signal, // Signal if Exists int &pusher, // Pushers string &provider, // Signal Provider Name + double &tp, // Provided TP + double &sl, // Provided SL bool _useSupport, // Generate Support Signals bool _allowLong, // Allow Long Signals bool _allowShort, // Allow Short Signals @@ -3046,7 +3052,9 @@ struct X121SignalGenerator HasLongConditions( conditions, pusher, - provider // + provider, + tp, + sl // ); // @@ -3069,7 +3077,9 @@ struct X121SignalGenerator HasShortConditions( conditions, pusher, - provider // + provider, + tp, + sl // ); // diff --git a/Classes/x-saherelm.x121.setup.cycle.class.mq5 b/Classes/x-saherelm.x121.setup.cycle.class.mq5 index 67aa77f1..6fdd5700 100644 --- a/Classes/x-saherelm.x121.setup.cycle.class.mq5 +++ b/Classes/x-saherelm.x121.setup.cycle.class.mq5 @@ -709,6 +709,8 @@ public: X121SetupConditions &conditions, int &pushers, string &provider, + double &tp, + double &sl, ENUM_X_MARKET_CYCLES cycle = X_MARKET_CYCLE_UNKNOWN, bool allowSupports = false, // Allow Support Signal Generating ... bool allowLong = false, @@ -753,6 +755,8 @@ public: signal, pushers, provider, + tp, + sl, allowSupports, allowLong, allowShort, diff --git a/Classes/x-saherelm.x121.setup.xea.mq5 b/Classes/x-saherelm.x121.setup.xea.mq5 index 98db8ca4..fd32af76 100644 --- a/Classes/x-saherelm.x121.setup.xea.mq5 +++ b/Classes/x-saherelm.x121.setup.xea.mq5 @@ -3578,6 +3578,8 @@ public: // // Current ... + double cTP = 0; + double cSL = 0; XSignal cSignal; int cPusher = 0; bool cHasSignal = false; @@ -3586,6 +3588,8 @@ public: // // Short ... + double sTP = 0; + double sSL = 0; XSignal sSignal; int sPusher = 0; bool sHasSignal = false; @@ -3594,6 +3598,8 @@ public: // // Medium ... + double mTP = 0; + double mSL = 0; XSignal mSignal; int mPusher = 0; bool mHasSignal = false; @@ -3602,6 +3608,8 @@ public: // // Long ... + double lTP = 0; + double lSL = 0; XSignal lSignal; int lPusher = 0; bool lHasSignal = false; @@ -3610,6 +3618,8 @@ public: // // Hind ... + double hTP = 0; + double hSL = 0; XSignal hSignal; int hPusher = 0; bool hHasSignal = false; @@ -3647,10 +3657,10 @@ public: // bool useCMarket = true; - bool useSMarket = false; - bool useMMarket = false; - bool useLMarket = false; - bool useHMarket = false; + bool useSMarket = true; + bool useMMarket = true; + bool useLMarket = true; + bool useHMarket = true; // for (int i = 0; i < count; i++) @@ -3674,6 +3684,8 @@ public: cConditions, cPusher, cProvider, + cTP, + cSL, X_MARKET_CYCLE_UNKNOWN, canSupport, allowLong, @@ -3706,6 +3718,8 @@ public: sConditions, sPusher, sProvider, + sTP, + sSL, X_MARKET_CYCLE_SHORT, canSupport, allowLong, @@ -3738,6 +3752,8 @@ public: mConditions, mPusher, mProvider, + mTP, + mSL, X_MARKET_CYCLE_MEDIUM, canSupport, allowLong, @@ -3770,6 +3786,8 @@ public: lConditions, lPusher, lProvider, + lTP, + lSL, X_MARKET_CYCLE_LONG, canSupport, allowLong, @@ -3802,6 +3820,8 @@ public: hConditions, hPusher, hProvider, + hTP, + hSL, X_MARKET_CYCLE_HIND, canSupport, allowLong, @@ -4089,6 +4109,13 @@ public: // bool isSignalValid = false; + // + isSignalValid = IsSignalDelayPassed(iSignal); + if (!isSignalValid) + { + continue; + } + // // Handle Close All Positions when Opposit Signal Recieved ... if (mCloseOnOpposit) @@ -4188,21 +4215,149 @@ public: } // + // Only Accept Next Same Type when Previous in Profit ... if (isSignalValid) { // - // Check Delay Between Two Signals ... - bool isDelayPassed = IsSignalDelayPassed(iSignal); + ENUM_X_POSITION_TYPES iType = + ToPositionType(iSignal.type); + XPosition iSymbolsPositions[]; + int iSymbolsPositionsCount = mTrader.GetPositions( + iSymbolsPositions, + iSignal.symbol, + NULL, // Provider + NULL, // Period + iType, // Type + true // + ); // - if (isDelayPassed) + int iSupportsCount = 0; + if (IsValidSize(iSymbolsPositionsCount)) { // - AddRef( - iSignal, - eSignals // + // Filter Support Positions ... + XPosition iSupports[]; + iSupportsCount = ExtractSupports( + iSymbolsPositions, + iSupports // + ); + + // + // Filter Support Positions ... + if (IsValidSize(iSupportsCount)) + { + // + XPosition tmpPositions[]; + Copy( + iSymbolsPositions, + tmpPositions // + ); + + // + Clean(iSymbolsPositions); + + // + for (int i = 0; i < iSymbolsPositionsCount; i++) + { + // + XPosition iPosition = tmpPositions[i]; + + // + bool isSupport = IsSupport(iPosition.comment); + if (isSupport) + { + continue; + } + + // + AddRef( + iPosition, + iSymbolsPositions // + ); + } + + // + iSymbolsPositionsCount = ArraySize(iSymbolsPositions); + } + } + + // + if (IsValidSize(iSymbolsPositionsCount)) + { + // + XPosition youngest; + int youngestAge = GetYoungest( + youngest, + iSymbolsPositions // + ); + + // + isSignalValid = youngest.profit > 0.1; + } + + // + if (!isSignalValid) + { + continue; + } + } + + // + // Multiply Signal Volume ... + if (isSignalValid) + { + // + XPosition iSymbolsPositions[]; + int iSymbolsPositionsCount = mTrader.GetPositions( + iSymbolsPositions, + iSignal.symbol, + NULL, // Provider + NULL, // Period + NULL, // Type + true // + ); + + // + int iSupportsCount = 0; + if (IsValidSize(iSymbolsPositionsCount)) + { + // + // Filter Support Positions ... + XPosition iSupports[]; + iSupportsCount = ExtractSupports( + iSymbolsPositions, + iSupports // ); } + + // + int multiplier = + iSupportsCount <= 0 + ? iSymbolsPositionsCount + : iSymbolsPositionsCount - iSupportsCount; + if (multiplier <= 0) + { + multiplier = 1; + } + else + { + multiplier++; + } + + // + iSignal.volume = iSignal.volume * multiplier; + } + + // + // Handle Signal ... + if (isSignalValid) + { + // + AddRef( + iSignal, + eSignals // + ); } } @@ -4885,6 +5040,9 @@ private: // Handle Force State Management ... void EQMHandleForceState() { + // + return; + // XPosition positions[]; int positionsCount = mTrader.GetPositions(positions); diff --git a/Classes/x-saherelm.xea.class.mq5 b/Classes/x-saherelm.xea.class.mq5 index 6d11464a..7651f72c 100644 --- a/Classes/x-saherelm.xea.class.mq5 +++ b/Classes/x-saherelm.xea.class.mq5 @@ -328,7 +328,6 @@ public: bool isSlept = IsSlept(); if (isSlept) { - Print("Slept"); return; } @@ -1166,7 +1165,7 @@ protected: // if (mRestingAfterHedge > 0) { - Sleep(mRestingAfterHedge * 1000); + Sleeping(mRestingAfterHedge); } // diff --git a/Documents/BKP/Templates/strategies.mq5 b/Documents/BKP/Templates/strategies.mq5 new file mode 100644 index 00000000..2a51f30c --- /dev/null +++ b/Documents/BKP/Templates/strategies.mq5 @@ -0,0 +1,1387 @@ + // + // Check Market Conditions for Long Signals ... + bool HasLongConditions( + X121SetupConditions &conditions, // Conditions + int &pusher, // Pushers + string &provider // Provider + ) + { + // + bool result = false; + + // + pusher = 0; + + // + bool isOSCShortVerified = IsOSCShortVerified(conditions); + + // + int zIndex = 0; + int cIndex = zIndex + 1; + int pIndex = cIndex + 1; + + // + double bullishScore = 0; + double bearishScore = 0; + conditions.GenerateScore( + bullishScore, + bearishScore // + ); + + // + // XMC ... + bool long1 = + // + // Starting Conditions ... + conditions.mcConditions.isSwitchedToBullish && + // + // Verifications ... + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.tdConditions.isBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long1) + { + // + pusher++; + provider = ToString(PROVIDER_XMC); + } + + // + // XSARD ... + bool long2 = + // + // Starting Conditions ... + conditions.mcConditions.isSARSwitchedToBullish && + // + // Verifications ... + conditions.mcConditions.isBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.tdConditions.isBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long2) + { + // + pusher++; + provider = ToString(PROVIDER_XSARD); + } + + // + // XADXTD ... + bool long3 = + // + // Starting Conditions ... + conditions.adxtdConditions.isStrongSwitchedToBullish && + // + // Verifications ... + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.tdConditions.isBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long3) + { + // + pusher++; + provider = ToString(PROVIDER_XADXTD); + } + + // + // XSTR ... + bool long4 = + // + // Starting Conditions ... + conditions.strConditions.isTrendSwitchedToBullish && + // + // Verifications ... + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.cheConditions.isStrongBullish && + conditions.tdConditions.isBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long4) + { + // + pusher++; + provider = ToString(PROVIDER_XSTR); + } + + // + // XCHE ... + bool long5 = + // + // Starting Conditions ... + conditions.cheConditions.isStrongSwitchedToBullish && + // + // Verifications ... + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.tdConditions.isBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long5) + { + // + pusher++; + provider = ToString(PROVIDER_XCHE); + } + + // + // XTD ... + bool long6 = + // + // Starting Conditions ... + conditions.tdConditions.isSwitchedToBullish && + // + // Verifications ... + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long6) + { + // + pusher++; + provider = ToString(PROVIDER_XTD); + } + + // + // XSI ... + bool long7 = + // + // Starting Conditions ... + conditions.rsi[cIndex] > 30 && + conditions.rsi[pIndex] <= 30 && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long7) + { + // + pusher++; + provider = ToString(PROVIDER_XSI); + } + + // + // XCI ... + bool long8 = + // + // Starting Conditions ... + conditions.cci[cIndex] > -100 && + conditions.cci[pIndex] <= -100 && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long8) + { + // + pusher++; + provider = ToString(PROVIDER_XCI); + } + + // + // XMCD ... + bool long9 = + // + // Starting Conditions ... + conditions.macd[cIndex] > 0 && + conditions.macd[cIndex] > conditions.macdSignal[cIndex] && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long9) + { + // + pusher++; + provider = ToString(PROVIDER_XMCD); + } + + // + // XICH ... + bool long10 = + // + // Starting Conditions ... + conditions.ichConditions.HasLongConditions() && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long10) + { + // + pusher++; + provider = ToString(PROVIDER_XICH); + } + + // + // XHK ... + bool long11 = + // + // Starting Conditions ... + conditions.hkConditions.isHKSwitchedToBullish && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long11) + { + // + pusher++; + provider = ToString(PROVIDER_XHK); + } + + // + // XSMHK ... + bool long12 = + // + // Starting Conditions ... + conditions.hkConditions.isSMHKSwitchedToBullish && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long12) + { + // + pusher++; + provider = ToString(PROVIDER_XSMHK); + } + + // + // XMRB ... + bool long13 = + // + // Starting Conditions ... + conditions.mrbConditions.isFastCrossedOverSlow && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.sslcConditions.isBullish && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long13) + { + // + pusher++; + provider = ToString(PROVIDER_XMRB); + } + + // + // XSSLC ... + bool long14 = + // + // Starting Conditions ... + conditions.sslcConditions.isSwitchedToBullish && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.hullConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long14) + { + // + pusher++; + provider = ToString(PROVIDER_XSSLC); + } + + // + // XHULL ... + bool long15 = + // + // Starting Conditions ... + conditions.hullConditions.isSwitchedToBullish && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.sslcConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long15) + { + // + pusher++; + provider = ToString(PROVIDER_XHULL); + } + + // + // XASCT ... + bool long16 = + // + // Starting Conditions ... + conditions.asctConditions.isLongSignal && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.hullConditions.isBullish && + conditions.sslcConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long16) + { + // + pusher++; + provider = ToString(PROVIDER_XASCT); + } + + // + // XVLM ... + bool long17 = + // + // Starting Conditions ... + conditions.vlmConditions.isVolumeChangedToBullish && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.hullConditions.isBullish && + conditions.sslcConditions.isBullish + // + ; + if (long17) + { + // + pusher++; + provider = ToString(PROVIDER_XVLM); + } + + // + // XPVF ... + bool long18 = + // + // Starting Conditions ... + conditions.pvConditions.isFiboIncreased && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.mcConditions.isBullish && + conditions.mcConditions.isSARBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish && + conditions.hkConditions.isHKBullish && + conditions.hkConditions.isSMHKBullish && + conditions.mrbConditions.isFastOverSlow && + conditions.hullConditions.isBullish && + conditions.sslcConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long18) + { + // + pusher++; + provider = ToString(PROVIDER_XPVF); + } + + // + // XPVSAR ... + bool long19 = + // + // Starting Conditions ... + conditions.mcConditions.isSARSwitchedToBullish && + conditions.pvConditions.vales[zIndex] == conditions.mcConditions.psar[zIndex] && + conditions.strConditions.isTrendBullish && + conditions.cheConditions.isStrongBullish + // + ; + if (long19) + { + // + pusher += 2; + provider = ToString(PROVIDER_XPVSAR); + } + + // + // XHTSRD ... + bool long20 = + // + // Starting Conditions ... + conditions.IsTrendBullish() && + conditions.dmntConditions.isBullish && + // + // Verifications ... + conditions.tdConditions.isBullish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBullish && + conditions.vlmConditions.isVolumeBullish + // + ; + if (long20) + { + // + pusher++; + provider = ToString(PROVIDER_XHTSRD); + } + + // + result = + // + pusher >= 1 && + // !isOSCShortVerified && + // bullishScore > bearishScore * 2 && + ( + // + long1 + // + || + // + long2 + // + || + // + long3 + // + || + // + long4 + // + || + // + long5 + // + || + // + long6 + // + || + // + long7 + // + || + // + long8 + // + || + // + long9 + // + || + // + long10 + // + || + // + long11 + // + || + // + long12 + // + || + // + long13 + // + || + // + long14 + // + || + // + long15 + // + || + // + long16 + // + || + // + long17 + // + || + // + long18 + // + || + // + long19 + // + || + // + long20 + // + ) + // + ; + + // + return result; + } + + // + // Check Market Conditions for Short Signals ... + bool HasShortConditions( + X121SetupConditions &conditions, // Conditions + int &pusher, // Pushers + string &provider // Provider + ) + { + // + bool result = false; + + // + pusher = 0; + + // + bool isOSCLongVerified = IsOSCLongVerified(conditions); + + // + int zIndex = 0; + int cIndex = zIndex + 1; + int pIndex = cIndex + 1; + + // + double bullishScore = 0; + double bearishScore = 0; + conditions.GenerateScore( + bullishScore, + bearishScore // + ); + + // + // XMC ... + bool short1 = + // + // Starting Conditions ... + conditions.mcConditions.isSwitchedToBearish && + // + // Verifications ... + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.tdConditions.isBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short1) + { + // + pusher++; + provider = ToString(PROVIDER_XMC); + } + + // + // XSARD ... + bool short2 = + // + // Starting Conditions ... + conditions.mcConditions.isSARSwitchedToBearish && + // + // Verifications ... + conditions.mcConditions.isBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.tdConditions.isBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short2) + { + // + pusher++; + provider = ToString(PROVIDER_XSARD); + } + + // + // XADXTD ... + bool short3 = + // + // Starting Conditions ... + conditions.adxtdConditions.isStrongSwitchedToBearish && + // + // Verifications ... + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.tdConditions.isBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short3) + { + // + pusher++; + provider = ToString(PROVIDER_XADXTD); + } + + // + // XSTR ... + bool short4 = + // + // Starting Conditions ... + conditions.strConditions.isTrendSwitchedToBearish && + // + // Verifications ... + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.cheConditions.isStrongBearish && + conditions.tdConditions.isBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short4) + { + // + pusher++; + provider = ToString(PROVIDER_XSTR); + } + + // + // XCHE ... + bool short5 = + // + // Starting Conditions ... + conditions.cheConditions.isStrongSwitchedToBearish && + // + // Verifications ... + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.tdConditions.isBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short5) + { + // + pusher++; + provider = ToString(PROVIDER_XCHE); + } + + // + // XTD ... + bool short6 = + // + // Starting Conditions ... + conditions.tdConditions.isSwitchedToBearish && + // + // Verifications ... + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short6) + { + // + pusher++; + provider = ToString(PROVIDER_XTD); + } + + // + // XSI ... + bool short7 = + // + // Starting Conditions ... + conditions.rsi[cIndex] < 70 && + conditions.rsi[pIndex] >= 70 && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short7) + { + // + pusher++; + provider = ToString(PROVIDER_XSI); + } + + // + // XCI ... + bool short8 = + // + // Starting Conditions ... + conditions.cci[cIndex] < 100 && + conditions.cci[pIndex] >= 100 && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short8) + { + // + pusher++; + provider = ToString(PROVIDER_XCI); + } + + // + // XMCD ... + bool short9 = + // + // Starting Conditions ... + conditions.macd[cIndex] < 0 && + conditions.macd[cIndex] < conditions.macdSignal[cIndex] && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short9) + { + // + pusher++; + provider = ToString(PROVIDER_XMCD); + } + + // + // XICH ... + bool short10 = + // + // Starting Conditions ... + conditions.ichConditions.HasShortConditions() && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short10) + { + // + pusher++; + provider = ToString(PROVIDER_XICH); + } + + // + // XHK ... + bool short11 = + // + // Starting Conditions ... + conditions.hkConditions.isHKSwitchedToBearish && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short11) + { + // + pusher++; + provider = ToString(PROVIDER_XHK); + } + + // + // XSMHK ... + bool short12 = + // + // Starting Conditions ... + conditions.hkConditions.isSMHKSwitchedToBearish && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short12) + { + // + pusher++; + provider = ToString(PROVIDER_XSMHK); + } + + // + // XMRB ... + bool short13 = + // + // Starting Conditions ... + conditions.mrbConditions.isFastCrossedUnderSlow && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.sslcConditions.isBearish && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short13) + { + // + pusher++; + provider = ToString(PROVIDER_XMRB); + } + + // + // XSSLC ... + bool short14 = + // + // Starting Conditions ... + conditions.sslcConditions.isSwitchedToBearish && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.hullConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short14) + { + // + pusher++; + provider = ToString(PROVIDER_XSSLC); + } + + // + // XHULL ... + bool short15 = + // + // Starting Conditions ... + conditions.hullConditions.isSwitchedToBearish && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.sslcConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short15) + { + // + pusher++; + provider = ToString(PROVIDER_XHULL); + } + + // + // XASCT ... + bool short16 = + // + // Starting Conditions ... + conditions.asctConditions.isShortSignal && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.hullConditions.isBearish && + conditions.sslcConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short16) + { + // + pusher++; + provider = ToString(PROVIDER_XASCT); + } + + // + // XVLM ... + bool short17 = + // + // Starting Conditions ... + conditions.vlmConditions.isVolumeChangedToBearish && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.hullConditions.isBearish && + conditions.sslcConditions.isBearish + // + ; + if (short17) + { + // + pusher++; + provider = ToString(PROVIDER_XVLM); + } + + // + // XPVF ... + bool short18 = + // + // Starting Conditions ... + conditions.pvConditions.isFiboDecreased && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.mcConditions.isBearish && + conditions.mcConditions.isSARBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish && + conditions.hkConditions.isHKBearish && + conditions.hkConditions.isSMHKBearish && + conditions.mrbConditions.isFastUnderSlow && + conditions.hullConditions.isBearish && + conditions.sslcConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short18) + { + // + pusher++; + provider = ToString(PROVIDER_XPVF); + } + + // + // XPVSAR ... + bool short19 = + // + // Starting Conditions ... + conditions.mcConditions.isSARSwitchedToBearish && + conditions.pvConditions.peaks[zIndex] == conditions.mcConditions.psar[zIndex] && + conditions.strConditions.isTrendBearish && + conditions.cheConditions.isStrongBearish + // + ; + if (short19) + { + // + pusher += 2; + provider = ToString(PROVIDER_XPVSAR); + } + + // + // XHTSRD ... + bool short20 = + // + // Starting Conditions ... + conditions.IsTrendBearish() && + conditions.dmntConditions.isBearish && + // + // Verifications ... + conditions.tdConditions.isBearish && + conditions.adxtdConditions.isStrong && + conditions.adxtdConditions.isBearish && + conditions.vlmConditions.isVolumeBearish + // + ; + if (short20) + { + // + pusher++; + provider = ToString(PROVIDER_XHTSRD); + } + + // + result = + // + pusher >= 1 && + // !isOSCLongVerified && + // bearishScore > bullishScore * 2 && + ( + // + short1 + // + || + // + short2 + // + || + // + short3 + // + || + // + short4 + // + || + // + short5 + // + || + // + short6 + // + || + // + short7 + // + || + // + short8 + // + || + // + short9 + // + || + // + short10 + // + || + // + short11 + // + || + // + short12 + // + || + // + short13 + // + || + // + short14 + // + || + // + short15 + // + || + // + short16 + // + || + // + short17 + // + || + // + short18 + // + || + // + short19 + // + || + // + short20 + // + ) + // + ; + + // + return result; + } diff --git a/Experts/x-saherelm.x121.ea.mq5 b/Experts/x-saherelm.x121.ea.mq5 index 16b064ce..f6e80158 100644 --- a/Experts/x-saherelm.x121.ea.mq5 +++ b/Experts/x-saherelm.x121.ea.mq5 @@ -44,15 +44,15 @@ input group "Signals"; //,USDCHFb,EURCHFb,USDJPYb,EURJPYb,GBPUSDb // EURUSDb,USDCHFb,EURCHFb,USDJPYb,EURJPYb,GBPUSDb // EURUSDb,USDCHFb,EURCHFb,USDJPYb,EURJPYb,GBPUSDb,XAUUSDb,NZDUSDb,AUDUSDb,USDCADb,BTCUSD,ETHUSD -input string x121EASymbols = "EURUSDb"; // Symbols -input bool x121EAUseAllSymbols = false; // Use All Available Symbols -input bool x121EAUseAllWatchListSymbols = false; // Use All WatchList Symbols -input bool x121EAAllowLong = true; // Allow Long Trades -input bool x121EAAllowShort = true; // Allow Short Trades -input bool x121EAExecuteSignalsOnBreakout = true; // Execute Signals On Breakouts -input int x121EADelayBetweenTwoSignal = 5; // Delay Between two Same Signals -input int x121EAReuiredSignalVerifications = 3; // Required Verifications for Signals -input bool x121EAGetVerificationFromOtherTimeFrames = false; // Get Verifications from Other Time Frames +input string x121EASymbols = "EURUSDb,USDCHFb,USDJPYb,GBPUSDb"; // Symbols +input bool x121EAUseAllSymbols = false; // Use All Available Symbols +input bool x121EAUseAllWatchListSymbols = false; // Use All WatchList Symbols +input bool x121EAAllowLong = true; // Allow Long Trades +input bool x121EAAllowShort = true; // Allow Short Trades +input bool x121EAExecuteSignalsOnBreakout = false; // Execute Signals On Breakouts +input int x121EADelayBetweenTwoSignal = 5; // Delay Between two Same Signals +input int x121EAReuiredSignalVerifications = 1; // Required Verifications for Signals +input bool x121EAGetVerificationFromOtherTimeFrames = false; // Get Verifications from Other Time Frames // // Risk Management ... @@ -60,7 +60,7 @@ input group "Risk Management"; input double x121EAVolume = 0.01; // Static Volume input double x121EATPPoint = 1000; // TP Point input double x121EASLPoint = 1000; // SL Point -input int x121EAMaxAllowedTrades = 1; // Max Allowed Positions Per Symbol +input int x121EAMaxAllowedTrades = 0; // Max Allowed Positions Per Symbol input bool x121EAUseMaxAllowedPerDirection = true; // Use Max Allowed Positions Per Direction input bool x121EAIgnoreSL = true; // Ignore Calculated SL input bool x121EAIgnoreTP = false; // Ignore Calculated TP @@ -94,7 +94,7 @@ input double x121EAMaxAllowedSupportVolume = 0.04; // Max Allowed Support Signal // input group "Grid"; input bool x121EAAllowGrid = false; // Allow Grid Signals -input bool x121EAGridOnlyForces = false; // Grid Only Force Signals +input bool x121EAGridOnlyForces = true; // Grid Only Force Signals input int x121EAMaxNumberOfGrids = 5; // Max Number of Grid Signals input double x121EAGridDistance = 100; // Grid Distance input double x121EAGridVolumeMultiplier = 2.0; // Grid Volume Multiplier @@ -111,8 +111,8 @@ input double x121EAMaxAllowedRecoveryVolume = 0.08; // Max Allowed Recovery Sign // input group "Hedging"; -input int x121EARestingAfterHedge = 0; // Resting Seconds After Hedge -input double x121EAMinRequiredProfitPerTrade = 0.2; // Minimum Required Profit for Hedging +input int x121EARestingAfterHedge = 1000; // Resting Seconds After Hedge +input double x121EAMinRequiredProfitPerTrade = 0.5; // Minimum Required Profit for Hedging input double x121EAMinRequiredProfitPerVolumeFactor = 0.01; // Minimum Required Profit for Hedging Per Volume // @@ -436,7 +436,7 @@ void X121PreConfigureStyles(X121SetupInputs &inputs) // // XATSL ... - inputs.atslInputs.show = false; + inputs.atslInputs.show = true; // // XSLN ... diff --git a/Helpers/x-saherelm.xmrb.helper.mq5 b/Helpers/x-saherelm.xmrb.helper.mq5 index 4c4423ca..2e421600 100644 --- a/Helpers/x-saherelm.xmrb.helper.mq5 +++ b/Helpers/x-saherelm.xmrb.helper.mq5 @@ -181,38 +181,38 @@ struct XMRBInputs { // // Ribbon 1 ... - fast1Length = 20; // Fast - slow1Length = 50; // Slow + fast1Length = 50; // Fast + slow1Length = 100; // Slow r1AppliedTo = PRICE_HIGH; // AppliedTo // // Ribbon 2 ... - fast2Length = 20; // Fast - slow2Length = 50; // Slow + fast2Length = 50; // Fast + slow2Length = 100; // Slow r2AppliedTo = PRICE_OPEN; // AppliedTo // // Ribbon 3 ... - fast3Length = 20; // Fast - slow3Length = 50; // Slow + fast3Length = 50; // Fast + slow3Length = 100; // Slow r3AppliedTo = PRICE_CLOSE; // AppliedTo // // Ribbon 4 ... - fast4Length = 20; // Fast - slow4Length = 50; // Slow + fast4Length = 50; // Fast + slow4Length = 100; // Slow r4AppliedTo = PRICE_MEDIAN; // AppliedTo // // Ribbon 5 ... - fast5Length = 20; // Fast - slow5Length = 50; // Slow + fast5Length = 50; // Fast + slow5Length = 100; // Slow r5AppliedTo = PRICE_TYPICAL; // AppliedTo // // Ribbon 6 ... - fast6Length = 20; // Fast - slow6Length = 50; // Slow + fast6Length = 50; // Fast + slow6Length = 100; // Slow r6AppliedTo = PRICE_LOW; // AppliedTo // @@ -1453,7 +1453,8 @@ private: { // int totalBars = CountBars(); - if (totalBars > 1000) { + if (totalBars > 1000) + { totalBars = 1000; }