// bool HasSenario1Conditions( ENUM_X_CYCLES cycle, XBoxZone &box, XBoxZone &holderBox, ENUM_X_DIRECTION &dir, X121SMCStrategySignalProviderData &provider, ENUM_X_CYCLES holderCycle = X_CYCLE_NONE, int barIndex = 0 // ) { // bool result = false; // // Fil Selected Data ... XPOIState cState; X121Conditions cXConditions; XC121SMCCycleHelper *cHelper; X121SMCCycleConditions cConditions; result = provider.SelectCycle( cycle, cState, cXConditions, cHelper, cConditions // ); if (!result) { // cState.Clean(); ZeroMemory(cHelper); cConditions.Clean(); cXConditions.Clean(); // return result; } Parse(cXConditions); // // Fil Selected Data ... XPOIState chState; X121Conditions chXConditions; XC121SMCCycleHelper *chHelper; X121SMCCycleConditions chConditions; if (holderCycle != X_CYCLE_NONE) { // result = provider.SelectCycle( holderCycle, chState, chXConditions, chHelper, chConditions // ); if (!result) { // chState.Clean(); ZeroMemory(chHelper); chConditions.Clean(); chXConditions.Clean(); // return result; } // Parse(chXConditions); } // // Normalize Args ... // box.Clean(); holderBox.Clean(); dir = X_DIRECTION_NONE; // if (barIndex < 0) { barIndex = 0; } // int idx = -1; int count = 0; bool has = false; // int zIDX = barIndex; int cIDX = zIDX + 1; int pIDX = cIDX + 1; // bool isBullish = false; bool isBearish = false; // XOHCL zBar; XOHCL cBar; XOHCL pBar; // // Initial Bars ... result = zBar.Init( cState.symbol, cState.period, barIndex // ); result = result && zBar.GetPreviousBar(cBar); result = result && cBar.GetPreviousBar(pBar); if (!result) { // zBar.Clean(); cBar.Clean(); pBar.Clean(); cState.Clean(); chState.Clean(); ZeroMemory(cHelper); cConditions.Clean(); cXConditions.Clean(); ZeroMemory(chHelper); chConditions.Clean(); chXConditions.Clean(); // return result; } // // // Detecting Signal Conditions ... // // Bullish Conditions ... isBullish = // // Base Condition ... cXConditions.isSMHKSwitchedToBullish && ( // // Validate CBar ... cBar.IsBullish() && // (cBar.low >= cXConditions.valesGoldenBuffer[cIDX] || (cBar.low < cXConditions.valesGoldenBuffer[cIDX] && cXConditions.isSarSwitchedToBullish)) && // (cBar.open == cXConditions.xhkSMOpenBuffer[cIDX] || (cBar.low < cXConditions.xhkSMLowBuffer[cIDX] && cBar.GetDown() > cXConditions.xhkSMHighBuffer[cIDX])) && // cXConditions.isSarBullish // ) // ; // // Bearish Conditions ... isBearish = // // Base Condition ... cXConditions.isSMHKSwitchedToBearish && ( // // Validate CBar ... cBar.IsBearish() && // (cBar.high <= cXConditions.peaksGoldenBuffer[cIDX] || (cBar.high > cXConditions.peaksGoldenBuffer[cIDX] && cXConditions.isSarSwitchedToBearish)) && // (cBar.open == cXConditions.xhkSMOpenBuffer[cIDX] || (cBar.high > cXConditions.xhkSMHighBuffer[cIDX] && cBar.GetUp() < cXConditions.xhkSMLowBuffer[cIDX])) && // cXConditions.isSarBearish // ) // ; // // Filling Requirements ... result = isBullish || isBearish; if (result) { // dir = isBullish ? X_DIRECTION_BULLISH : X_DIRECTION_BEARISH; // box.dir = dir; box.to = TimeCurrent(); box.symbol = cXConditions.symbol; box.period = cXConditions.period; // int fromIDX = -1; if (isBullish) { // double vale = cXConditions.valesBuffer[cIDX]; box.lower = vale; box.upper = cXConditions.valesGoldenBuffer[cIDX]; // int lowerValeIDX = -1; double lowerVale = cHelper .mX121Helper .xpvHelper .GetLowerVale( lowerValeIDX, vale, cBar.Index() // ); // int higherValeIDX = -1; double higherVale = cHelper .mX121Helper .xpvHelper .GetHigherVale( higherValeIDX, vale, cBar.Index() // ); // if (IsValidIndex(lowerValeIDX) && IsValidIndex(higherValeIDX)) { // fromIDX = lowerValeIDX < higherValeIDX ? lowerValeIDX : higherValeIDX; } else if (IsValidIndex(lowerValeIDX) && !IsValidIndex(higherValeIDX)) { // fromIDX = lowerValeIDX; } else if (!IsValidIndex(lowerValeIDX) && IsValidIndex(higherValeIDX)) { // fromIDX = higherValeIDX; } } else { // double peak = cXConditions.peaksBuffer[cIDX]; box.upper = peak; // box.lower = cXConditions.peaksGoldenBuffer[cIDX]; // int lowerPeakIDX = -1; double lowerPeak = cHelper .mX121Helper .xpvHelper .GetLowerPeak( lowerPeakIDX, peak, cBar.Index() // ); // int higherPeakIDX = -1; double higherPeak = cHelper .mX121Helper .xpvHelper .GetHigherPeak( higherPeakIDX, peak, cBar.Index() // ); // if (IsValidIndex(lowerPeakIDX) && IsValidIndex(higherPeakIDX)) { // fromIDX = lowerPeakIDX < higherPeakIDX ? lowerPeakIDX : higherPeakIDX; } else if (IsValidIndex(lowerPeakIDX) && !IsValidIndex(higherPeakIDX)) { // fromIDX = lowerPeakIDX; } else if (!IsValidIndex(lowerPeakIDX) && IsValidIndex(higherPeakIDX)) { // fromIDX = higherPeakIDX; } } // if (IsValidIndex(fromIDX)) { // box.from = iTime( zBar.symbol, zBar.period, fromIDX // ); } else { box.from = pBar.time; } // // Detect Holder Box ... XBoxZone tmpBoxes[]; if (chState.IsValid()) { // if (isBullish) { // // Demand Zones ... XBoxZone tmp[]; ToBox( chState.demandZones, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); // // Bullish Order Blocks ... ToBox( chState.bullishOrderBlocks, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); // // Bullish Fair Value Gaps ... ToBox( chState.bullishFairValueGaps, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); } else { // // Supply Zones ... XBoxZone tmp[]; ToBox( chState.supplyZones, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); // // Bearish Order Blocks ... ToBox( chState.bearishOrderBlocks, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); // // Bearish Fair Value Gaps ... ToBox( chState.bearishFairValueGaps, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); } } // has = HasChild(tmpBoxes); if (has) { // while (HasChild(tmpBoxes)) { // idx = GetOldest(tmpBoxes); has = IsValidIndex(idx); if (!has) { break; } // XBoxZone iBox = tmpBoxes[idx]; ArrayRemove( tmpBoxes, idx, 1 // ); // has = IsBoxInside( box, iBox // ); if (has) { // holderBox = iBox; holderBox.to = TimeCurrent(); iBox.Clean(); break; } // iBox.Clean(); } } // Clean(tmpBoxes); // // Fix Box Upper and Lower based on Strategy ... // double points = GetPoints(box.symbol); double minPointsDiff = points * 20; // double prefferSL = 0; // // Other SL Conditions ... if (prefferSL <= 0) { // if (isBullish) { // if (zBar.open < cXConditions.valesGoldenBuffer[cIDX]) { prefferSL = cXConditions.valesBuffer[cIDX]; } else if (zBar.open > cXConditions.valesGoldenBuffer[cIDX] && zBar.open < cXConditions.peaksGoldenBuffer[cIDX]) { prefferSL = cXConditions.valesGoldenBuffer[cIDX]; } else if (zBar.open > cXConditions.peaksGoldenBuffer[cIDX]) { // if (cXConditions.sarBuffer[cIDX] > cXConditions.peaksGoldenBuffer[cIDX]) { prefferSL = cXConditions.sarBuffer[cIDX]; } else { prefferSL = zBar.open > cXConditions.peaksGoldenBuffer[cIDX]; } } } else { // if (zBar.open > cXConditions.peaksGoldenBuffer[cIDX]) { prefferSL = cXConditions.peaksBuffer[cIDX]; } else if (zBar.open < cXConditions.peaksGoldenBuffer[cIDX] && zBar.open > cXConditions.valesGoldenBuffer[cIDX]) { prefferSL = cXConditions.peaksGoldenBuffer[cIDX]; } else if (zBar.open < cXConditions.valesGoldenBuffer[cIDX]) { // if (cXConditions.sarBuffer[cIDX] < cXConditions.valesGoldenBuffer[cIDX]) { prefferSL = cXConditions.sarBuffer[cIDX]; } else { prefferSL = cXConditions.valesGoldenBuffer[cIDX]; } } } } // if (prefferSL > 0) { // box.upper = isBullish ? zBar.open : prefferSL; // box.lower = isBullish ? prefferSL : zBar.open; } // // Validate Conditions to Force Has Holder Box ... result = result && holderBox.IsValid() && dir == holderBox.dir; // if (!result) { // isBullish = false; isBearish = false; } } // // Check All Conditions ... result = box.IsValid() && HasDirection(dir) && (isBullish || isBearish); // // Cleanup Resources ... zBar.Clean(); cBar.Clean(); pBar.Clean(); cState.Clean(); chState.Clean(); ZeroMemory(cHelper); cConditions.Clean(); cXConditions.Clean(); ZeroMemory(chHelper); chConditions.Clean(); chXConditions.Clean(); // return result; } // bool HasSenario2Conditions( ENUM_X_CYCLES ttfCycle, XBoxZone &breakedBoxes[], XBoxZone &box, ENUM_X_DIRECTION &dir, X121SMCStrategySignalProviderData &provider, int barIndex = 0, bool forceBarType = false, bool forceFiboPressure = false // ) { // bool result = false; // // Validate Args ... result = IsValid(ttfCycle) && HasChild(breakedBoxes); if (!result) { return result; } // // TODO: Add support for Extracting Trend ... ENUM_X_DIRECTION trend = X_DIRECTION_NONE; bool hasBullishTrend = IsBullish(trend); bool hasBearishTrend = IsBearish(trend); // // TTF Cycle Extract ... XPOIState ttfState; X121Conditions ttfXConditions; XC121SMCCycleHelper *ttfHelper; X121SMCCycleConditions ttfConditions; result = provider.SelectCycle( ttfCycle, ttfState, ttfXConditions, ttfHelper, ttfConditions // ); if (!result) { // ttfState.Clean(); ZeroMemory(ttfHelper); ttfConditions.Clean(); ttfXConditions.Clean(); // return result; } Parse(ttfXConditions); // // Normalize Args ... // box.Clean(); dir = X_DIRECTION_NONE; // if (barIndex < 0) { barIndex = 0; } // // Define Resources ... // int idx = -1; int count = 0; bool has = false; // int zIDX = barIndex; int cIDX = zIDX + 1; int pIDX = cIDX + 1; // double ask = GetAsk(ttfState.symbol); double bid = GetBid(ttfState.symbol); // bool isBullish = false; bool isBearish = false; // XOHCL zBar; XOHCL cBar; XOHCL pBar; // // Initial Bars ... result = zBar.Init( ttfState.symbol, ttfState.period, barIndex // ); result = result && zBar.GetPreviousBar(cBar); result = result && cBar.GetPreviousBar(pBar); if (!result) { // zBar.Clean(); cBar.Clean(); pBar.Clean(); ttfState.Clean(); ZeroMemory(ttfHelper); ttfConditions.Clean(); ttfXConditions.Clean(); // return result; } // // Conditions ... // // First we Have to Detect Inside Box ... XBoxZone insideBox; count = ArraySize(breakedBoxes); for (int i = 0; i < count; i++) { // XBoxZone iBox = breakedBoxes[i]; // bool isInside = IsInsideBox( zBar, iBox // ); if (isInside) { // // Since we have to Follow Trend based on Breaked Boxes ... // we have to use: // - Breaked Bullish Boxes on Bearish Trend ... // - Breaked Bearish Boxes on Bullish Trend ... isInside = hasBullishTrend ? iBox.IsBearish() : hasBearishTrend ? iBox.IsBullish() : false; // // Check Inside ... if (isInside) { // insideBox = iBox; iBox.Clean(); // break; } } // iBox.Clean(); } // // Check Inside Box is Valid or not ... result = insideBox.IsValid(); if (!result) { // zBar.Clean(); cBar.Clean(); pBar.Clean(); ttfState.Clean(); insideBox.Clean(); ZeroMemory(ttfHelper); ttfConditions.Clean(); ttfXConditions.Clean(); } // // Update Inside Box From and To ... // Based on Breaked ... insideBox.from = insideBox.to; insideBox.to = TimeCurrent(); // // Detect Breaked Box Direction ... bool isInsideBoxBullish = insideBox.IsBullish(); bool isInsideBoxBearish = insideBox.IsBearish(); // // Detect Inside Box Rejection ... // bool isUpperBearishReject = cBar.high >= insideBox.upper && cBar.GetUp() < insideBox.upper; // bool isUpperBullishReject = cBar.low <= insideBox.upper && cBar.GetDown() > insideBox.upper; // bool isLowerBearishReject = cBar.high >= insideBox.lower && cBar.GetUp() < insideBox.lower; // bool isLowerBullishReject = cBar.low <= insideBox.lower && cBar.GetDown() > insideBox.lower; // // Apply Force Bar Type ... if (forceBarType) { // isUpperBearishReject = isUpperBearishReject && cBar.IsBearish(); // isUpperBullishReject = isUpperBullishReject && cBar.IsBullish(); // isLowerBearishReject = isLowerBearishReject && cBar.IsBearish(); // isLowerBullishReject = isLowerBullishReject && cBar.IsBullish(); } // // Apply Force Fibo Pressure ... if (forceBarType) { // isUpperBearishReject = isUpperBearishReject && ttfHelper .mBarAnalyser .HasFiboPressure( cBar, X_DIRECTION_BEARISH, X_FIBO_LEVEL_382 // ); // isUpperBullishReject = isUpperBullishReject && ttfHelper .mBarAnalyser .HasFiboPressure( cBar, X_DIRECTION_BULLISH, X_FIBO_LEVEL_382 // ); // isLowerBearishReject = isLowerBearishReject && ttfHelper .mBarAnalyser .HasFiboPressure( cBar, X_DIRECTION_BEARISH, X_FIBO_LEVEL_382 // ); // isLowerBullishReject = isLowerBullishReject && ttfHelper .mBarAnalyser .HasFiboPressure( cBar, X_DIRECTION_BULLISH, X_FIBO_LEVEL_382 // ); } // // Bullish Conditions ... isBullish = ( // hasBullishTrend && isInsideBoxBearish && isLowerBullishReject // ); // // Bearish Conditions ... isBearish = ( // hasBearishTrend && isInsideBoxBullish && isUpperBearishReject // ); // // Filling Requirements ... result = isBullish || isBearish; if (result) { // box = insideBox; // dir = isBullish ? X_DIRECTION_BULLISH : X_DIRECTION_BEARISH; } // // Check All Conditions ... result = box.IsValid() && HasDirection(dir) && (isBullish || isBearish // ); // // Cleanup Resource ... // zBar.Clean(); cBar.Clean(); pBar.Clean(); // ttfState.Clean(); insideBox.Clean(); ZeroMemory(ttfHelper); ttfConditions.Clean(); ttfXConditions.Clean(); // return result; } // bool HasSenario4Conditions( ENUM_X_CYCLES cycle, XBoxZone &box, XBoxZone &holderBox, ENUM_X_DIRECTION &dir, X121SMCStrategySignalProviderData &provider, ENUM_X_CYCLES holderCycle = X_CYCLE_NONE, int barIndex = 0 // ) { // bool result = false; // // Fil Selected Data ... XPOIState cState; X121Conditions cXConditions; XC121SMCCycleHelper *cHelper; X121SMCCycleConditions cConditions; result = provider.SelectCycle( cycle, cState, cXConditions, cHelper, cConditions // ); if (!result) { // cState.Clean(); ZeroMemory(cHelper); cConditions.Clean(); cXConditions.Clean(); // return result; } Parse(cXConditions); // // Fil Selected Data ... XPOIState chState; X121Conditions chXConditions; XC121SMCCycleHelper *chHelper; X121SMCCycleConditions chConditions; if (holderCycle != X_CYCLE_NONE) { // result = provider.SelectCycle( holderCycle, chState, chXConditions, chHelper, chConditions // ); if (!result) { // chState.Clean(); ZeroMemory(chHelper); chConditions.Clean(); chXConditions.Clean(); // return result; } // Parse(chXConditions); } // // Normalize Args ... // box.Clean(); holderBox.Clean(); dir = X_DIRECTION_NONE; // if (barIndex < 0) { barIndex = 0; } // int idx = -1; int count = 0; bool has = false; // int zIDX = barIndex; int cIDX = zIDX + 1; int pIDX = cIDX + 1; // bool isBullish = false; bool isBearish = false; // XOHCL zBar; XOHCL cBar; XOHCL pBar; // // Initial Bars ... result = zBar.Init( cState.symbol, cState.period, barIndex // ); result = result && zBar.GetPreviousBar(cBar); result = result && cBar.GetPreviousBar(pBar); if (!result) { // zBar.Clean(); cBar.Clean(); pBar.Clean(); cState.Clean(); chState.Clean(); ZeroMemory(cHelper); cConditions.Clean(); cXConditions.Clean(); ZeroMemory(chHelper); chConditions.Clean(); chXConditions.Clean(); // return result; } // // Detecting Signal Conditions ... // // Bullish Conditions ... isBullish = // // Base Condition ... ( // cBar.IsBullish() && zBar.open >= cBar.close && ( // // Regular Reject ... (pBar.low > cBar.low && cBar.low < cXConditions.valesGoldenBuffer[cIDX] && cBar.GetDown() > cXConditions.valesGoldenBuffer[cIDX]) // || // // Regular Exit ... (pBar.low < cXConditions.valesGoldenBuffer[cIDX] && (cBar.low > cXConditions.valesGoldenBuffer[cIDX] || cBar.GetUp() > cXConditions.valesGoldenBuffer[cIDX])) // || // IsBarBreak( cXConditions.valesGoldenBuffer[cIDX], X_DIRECTION_BULLISH, cBar // ) // || // IsBarReject( cXConditions.valesGoldenBuffer[cIDX], X_DIRECTION_BULLISH, cBar // ) // ) // ) // && // // Checking other Conditions ... ( // // XSAR ... cXConditions.isSarBullish && // // XSTR ... cXConditions.isStrSwitchedToBullish && // // // X3MA ... // // XVWAP ... // (cXConditions.isX3MaFastOverMid || // cXConditions.isVWapFastOverMid) && // // XHK ... cXConditions.isSMHKBullish && cXConditions.isRawHKBullish && // // XCHE ... cXConditions.isCheBullish && cXConditions.le1Buffer[cIDX] < cBar.low && cXConditions.le2Buffer[cIDX] < cBar.low // ) // ; // // Bearish Conditions ... isBearish = // // Base Condition ... ( // cBar.IsBearish() && zBar.open <= cBar.close && ( // // Regular Reject ... (pBar.high < cBar.high && cBar.high > cXConditions.peaksGoldenBuffer[cIDX] && cBar.GetUp() < cXConditions.peaksGoldenBuffer[cIDX]) // || // // Regular Exit ... (pBar.high > cXConditions.peaksGoldenBuffer[cIDX] && (cBar.high < cXConditions.peaksGoldenBuffer[cIDX] || cBar.GetDown() < cXConditions.peaksGoldenBuffer[cIDX])) // || // IsBarBreak( cXConditions.peaksGoldenBuffer[cIDX], X_DIRECTION_BEARISH, cBar // ) // || // IsBarReject( cXConditions.peaksGoldenBuffer[cIDX], X_DIRECTION_BEARISH, cBar // ) // ) // ) // && // // Checking other Conditions ... ( // // XSAR ... cXConditions.isSarBearish && // // XSTR ... cXConditions.isStrSwitchedToBearish && // // // X3MA ... // // XVWAP ... // (cXConditions.isX3MaFastUnderMid || // cXConditions.isVWapFastUnderMid) && // // XHK ... cXConditions.isSMHKBearish && cXConditions.isRawHKBearish && // // XCHE ... cXConditions.isCheBearish && cXConditions.se1Buffer[cIDX] > cBar.high && cXConditions.se2Buffer[cIDX] > cBar.high // ) // ; // // Filling Requirements ... result = isBullish || isBearish; if (result) { // dir = isBullish ? X_DIRECTION_BULLISH : X_DIRECTION_BEARISH; // box.dir = dir; box.to = TimeCurrent(); box.symbol = cXConditions.symbol; box.period = cXConditions.period; // int fromIDX = -1; if (isBullish) { // double vale = cXConditions.valesBuffer[cIDX]; box.lower = vale; box.upper = cXConditions.valesGoldenBuffer[cIDX]; // int lowerValeIDX = -1; double lowerVale = cHelper .mX121Helper .xpvHelper .GetLowerVale( lowerValeIDX, vale, cBar.Index() // ); // int higherValeIDX = -1; double higherVale = cHelper .mX121Helper .xpvHelper .GetHigherVale( higherValeIDX, vale, cBar.Index() // ); // if (IsValidIndex(lowerValeIDX) && IsValidIndex(higherValeIDX)) { // fromIDX = lowerValeIDX < higherValeIDX ? lowerValeIDX : higherValeIDX; } else if (IsValidIndex(lowerValeIDX) && !IsValidIndex(higherValeIDX)) { // fromIDX = lowerValeIDX; } else if (!IsValidIndex(lowerValeIDX) && IsValidIndex(higherValeIDX)) { // fromIDX = higherValeIDX; } } else { // double peak = cXConditions.peaksBuffer[cIDX]; box.upper = peak; // box.lower = cXConditions.peaksGoldenBuffer[cIDX]; // int lowerPeakIDX = -1; double lowerPeak = cHelper .mX121Helper .xpvHelper .GetLowerPeak( lowerPeakIDX, peak, cBar.Index() // ); // int higherPeakIDX = -1; double higherPeak = cHelper .mX121Helper .xpvHelper .GetHigherPeak( higherPeakIDX, peak, cBar.Index() // ); // if (IsValidIndex(lowerPeakIDX) && IsValidIndex(higherPeakIDX)) { // fromIDX = lowerPeakIDX < higherPeakIDX ? lowerPeakIDX : higherPeakIDX; } else if (IsValidIndex(lowerPeakIDX) && !IsValidIndex(higherPeakIDX)) { // fromIDX = lowerPeakIDX; } else if (!IsValidIndex(lowerPeakIDX) && IsValidIndex(higherPeakIDX)) { // fromIDX = higherPeakIDX; } } // if (IsValidIndex(fromIDX)) { // box.from = iTime( zBar.symbol, zBar.period, fromIDX // ); } else { box.from = pBar.time; } // // Detect Holder Box ... XBoxZone tmpBoxes[]; if (chState.IsValid()) { // if (isBullish) { // // Demand Zones ... XBoxZone tmp[]; ToBox( chState.demandZones, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); // // Bullish Order Blocks ... ToBox( chState.bullishOrderBlocks, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); // // Bullish Fair Value Gaps ... ToBox( chState.bullishFairValueGaps, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); } else { // // Supply Zones ... XBoxZone tmp[]; ToBox( chState.supplyZones, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); // // Bearish Order Blocks ... ToBox( chState.bearishOrderBlocks, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); // // Bearish Fair Value Gaps ... ToBox( chState.bearishFairValueGaps, tmp // ); Copy( tmp, tmpBoxes, false // ); Clean(tmp); } } // has = HasChild(tmpBoxes); if (has) { // while (HasChild(tmpBoxes)) { // idx = GetOldest(tmpBoxes); has = IsValidIndex(idx); if (!has) { break; } // XBoxZone iBox = tmpBoxes[idx]; ArrayRemove( tmpBoxes, idx, 1 // ); // has = IsBoxInside( box, iBox // ); if (has) { // holderBox = iBox; holderBox.to = TimeCurrent(); iBox.Clean(); break; } // iBox.Clean(); } } // Clean(tmpBoxes); // // Validate Conditions to Force Has Holder Box ... result = result && holderBox.IsValid(); if (!result) { // isBullish = false; isBearish = false; } } // // Check All Conditions ... result = box.IsValid() && HasDirection(dir) && (isBullish || isBearish); // // Cleanup Resources ... zBar.Clean(); cBar.Clean(); pBar.Clean(); cState.Clean(); chState.Clean(); ZeroMemory(cHelper); cConditions.Clean(); cXConditions.Clean(); ZeroMemory(chHelper); chConditions.Clean(); chXConditions.Clean(); // return result; }