XBoxZone iPeak; XBoxZone iVale; XBoxZone iOBBull; XBoxZone iOBBear; XBoxZone iMTBull; XBoxZone iMTBear; // iPeak.Clean(); iVale.Clean(); iOBBull.Clean(); iOBBear.Clean(); iMTBull.Clean(); iMTBear.Clean(); // // Select MT Block ... // if (result) // { // // // // New MT Pivot Detected ... // if (detector.newMTBullishPivotDetected) // { // // // idx = GetYoungest(detector.mtBullishPivots); // if (IsValidIndex(idx)) // { // iMTBull = detector.mtBullishPivots[idx]; // } // } // else if (detector.newMTBearishPivotDetected) // { // // // idx = GetYoungest(detector.mtBearishPivots); // if (IsValidIndex(idx)) // { // iMTBear = detector.mtBearishPivots[idx]; // } // } // // // // Draw MT ... // // // // Bullish ... // has = iMTBull.IsValid(); // if (has) // { // // // iMTBull.to = conditions.bars[zIDX].time; // // // XCBoxObject *iObj; // has = drawer // .drawer // .DrawBox( // iMTBull, // iObj // // ); // if (has) // { // drawer.ApplyMTBullishPivotStyle(iObj); // } // } // // // // Bearish ... // has = iMTBear.IsValid(); // if (has) // { // // // iMTBear.to = conditions.bars[zIDX].time; // // // XCBoxObject *iObj; // has = drawer // .drawer // .DrawBox( // iMTBear, // iObj // // ); // if (has) // { // drawer.ApplyMTBearishPivotStyle(iObj); // } // } // } // // Select Peak and Vale ... // this used to Signalling Better ... // if (result) // { // // // // Select Peak ... // idx = GetLowest( // conditions.bars[cIDX], // detector.peakPivots // // ); // if (IsValidIndex(idx)) // { // // // iPeak = detector.peakPivots[idx]; // iPeak.to = conditions.bars[zIDX].time; // } // // // // Select Vale ... // idx = GetHighest( // conditions.bars[cIDX], // detector.valePivots // // ); // if (IsValidIndex(idx)) // { // // // iVale = detector.valePivots[idx]; // iVale.to = conditions.bars[zIDX].time; // } // // // // Checkig Result ... // result = // iPeak.IsValid() && // iVale.IsValid(); // // // // Draw Peak and Vales ... // if (result) // { // // // // Object Definitions ... // XCBoxObject *iObj; // // // // Draw Peak ... // has = drawer // .drawer // .DrawBox( // iPeak, // iObj // // ); // if (has) // { // drawer.ApplyPeakPivotStyle(iObj); // } // ZeroMemory(iObj); // // // // Draw Vale ... // has = drawer // .drawer // .DrawBox( // iVale, // iObj // // ); // if (has) // { // drawer.ApplyValePivotStyle(iObj); // } // ZeroMemory(iObj); // } // } // // // // We Have to Detect Youngest Order Block ... // // or Mitigation Block ... // if (isCond1Bullish) // { // // // // // // OB ... // // idx = GetYoungest(detector.obBullishPivots); // // has = IsValidIndex(idx); // // if (has) // // { // // iOB = detector.obBullishPivots[idx]; // // } // // // // MT ... // idx = GetYoungest(detector.mtBullishPivots); // has = IsValidIndex(idx); // if (has) // { // iOB = detector.mtBullishPivots[idx]; // } // } // else if (isCond1Bearish) // { // // // // OB // // idx = GetYoungest(detector.obBearishPivots); // // has = IsValidIndex(idx); // // if (has) // // { // // iOB = detector.obBearishPivots[idx]; // // } // // // // MT // idx = GetYoungest(detector.mtBearishPivots); // has = IsValidIndex(idx); // if (has) // { // iMT = detector.mtBearishPivots[idx]; // } // } // // // // Now we can Do some Verifications Using these ... // result = // isCond1Bullish // ? iMT.IsBullish() // : iMT.IsBearish(); // if (!result) // { // // // isCond1Bullish = false; // isCond1Bearish = false; // } // // All Requirements based on Cond 1 ...