last ...
This commit is contained in:
@@ -1686,3 +1686,293 @@ bool Strategy1HasSignal(
|
||||
//
|
||||
return result;
|
||||
}
|
||||
|
||||
// //
|
||||
// isBullish =
|
||||
// // majorSupport.IsValid() &&
|
||||
// minorSupport.IsValid() &&
|
||||
// poiDetector.IsKIBullishPOI(barIndex) &&
|
||||
// poiDetector.HasCandlestickDirection(
|
||||
// iBar,
|
||||
// X_DIRECTION_BULLISH //
|
||||
// ) &&
|
||||
// IsTFBullishPattern(barIndex, PERIOD_M5) &&
|
||||
// // minorSupport.lower <= majorSupport.upper &&
|
||||
// poiDetector.IsNearZone(iBar.close, minorSupport, 10);
|
||||
|
||||
// //
|
||||
// isBearish =
|
||||
// // majorResistance.IsValid() &&
|
||||
// minorResistance.IsValid() &&
|
||||
// poiDetector.IsKIBearishPOI(barIndex) &&
|
||||
// poiDetector.HasCandlestickDirection(
|
||||
// iBar,
|
||||
// X_DIRECTION_BEARISH //
|
||||
// ) &&
|
||||
// IsTFBearishPattern(barIndex, PERIOD_M5) &&
|
||||
// // minorResistance.upper >= majorResistance.lower &&
|
||||
// poiDetector.IsNearZone(iBar.close, minorResistance, 10);
|
||||
|
||||
//
|
||||
// Retrieve Base Conditions ...
|
||||
// isBullish =
|
||||
// isBullish &&
|
||||
// IsBullishPOILongEntry(barIndex);
|
||||
// isBearish =
|
||||
// isBearish &&
|
||||
// IsBearishPOIShortEntry(barIndex);
|
||||
|
||||
// //
|
||||
// // Do Validation and Filtering Market Structure if required ...
|
||||
|
||||
// //
|
||||
// // Validate near Support / Resistance Zones ...
|
||||
// bool validateNearSupRes = true;
|
||||
// if (result && validateNearSupRes)
|
||||
// {
|
||||
// //
|
||||
// // Configs ...
|
||||
// int loopback = 100;
|
||||
// int validationLength = 7;
|
||||
// double nearThreshold = 5;
|
||||
// int validationRetests = 0;
|
||||
// int validationLoopback = 100;
|
||||
// double validationThreshold = 5;
|
||||
|
||||
// //
|
||||
// // Filling Zones ...
|
||||
// XBoxZone zones[];
|
||||
// if (isBullish)
|
||||
// {
|
||||
// //
|
||||
// // Detect Supports ...
|
||||
// poiDetector.DetectSupports(
|
||||
// zones,
|
||||
// barIndex,
|
||||
// loopback,
|
||||
// true,
|
||||
// validationLength, // Validation Length ...
|
||||
// validationRetests, // Min Retest ...
|
||||
// validationThreshold, // Retest Threshold ...
|
||||
// validationLoopback, // Retest Loopback ...
|
||||
// symbol,
|
||||
// period //
|
||||
// );
|
||||
// }
|
||||
// else if (isBearish)
|
||||
// {
|
||||
// //
|
||||
// // Detect Resistances ...
|
||||
// poiDetector.DetectResistances(
|
||||
// zones,
|
||||
// barIndex,
|
||||
// loopback,
|
||||
// true,
|
||||
// validationLength, // Validation Length ...
|
||||
// validationRetests, // Min Retest ...
|
||||
// validationThreshold, // Retest Threshold ...
|
||||
// validationLoopback, // Retest Loopback ...
|
||||
// symbol,
|
||||
// period //
|
||||
// );
|
||||
// }
|
||||
|
||||
// //
|
||||
// if (HasChild(zones))
|
||||
// {
|
||||
// //
|
||||
// XPOIDrawConfig iConfig;
|
||||
// iConfig.Default();
|
||||
|
||||
// //
|
||||
// poiDrawer.DrawZones(zones, iConfig);
|
||||
// iConfig.Clean();
|
||||
// // DebugBreak();
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Check Has Nearest ...
|
||||
// int nearIDX = -1;
|
||||
// result = poiDetector.HasNearZone(
|
||||
// nearIDX,
|
||||
// bar.close,
|
||||
// nearThreshold,
|
||||
// zones //
|
||||
// );
|
||||
|
||||
// //
|
||||
// // Validate ...
|
||||
// if (!result)
|
||||
// {
|
||||
// //
|
||||
// isBullish = false;
|
||||
// isBearish = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Validate by ATR Rising/Falling ...
|
||||
// bool validateByATRRaisFalling = true;
|
||||
// if (result && validateByATRRaisFalling)
|
||||
// {
|
||||
// //
|
||||
// // Bullish:
|
||||
// // - ATR Lower Rising ...
|
||||
// // - ATR Over ATR Ma ...
|
||||
// // Bearsih:
|
||||
// // - ATR Upper Falling ...
|
||||
// // - ATR Over ATR Ma ...
|
||||
|
||||
// //
|
||||
// isBullish =
|
||||
// isBullish &&
|
||||
// // kiHelper.GetATR(barIndex) > kiHelper.GetATRSmoothed(barIndex) &&
|
||||
// kiHelper.GetKILower(barIndex) > kiHelper.GetKILower(barIndex + 1);
|
||||
// isBearish =
|
||||
// isBearish &&
|
||||
// // kiHelper.GetATR(barIndex) > kiHelper.GetATRSmoothed(barIndex) &&
|
||||
// kiHelper.GetKIUpper(barIndex) < kiHelper.GetKIUpper(barIndex + 1);
|
||||
// result = isBullish || isBearish;
|
||||
|
||||
// //
|
||||
// if (!result)
|
||||
// {
|
||||
// //
|
||||
// isBullish = false;
|
||||
// isBearish = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Validate by RSI ...
|
||||
// bool validatebyRSI = false;
|
||||
// if (result && validatebyRSI)
|
||||
// {
|
||||
// //
|
||||
// // Bullish:
|
||||
// // - Not in Over Baught;
|
||||
// // - Rising;
|
||||
// // Bearish :
|
||||
// // - Not in Over Sold;
|
||||
// // - Falling;
|
||||
|
||||
// //
|
||||
// isBullish =
|
||||
// isBullish &&
|
||||
// !kiParser.IsRSIOverbought(barIndex) &&
|
||||
// kiHelper.GetRSI(barIndex) > kiHelper.GetRSI(barIndex + 1);
|
||||
// isBearish =
|
||||
// isBearish &&
|
||||
// !kiParser.IsRSIOversold(barIndex) &&
|
||||
// kiHelper.GetRSI(barIndex) < kiHelper.GetRSI(barIndex + 1);
|
||||
// result = isBullish || isBearish;
|
||||
|
||||
// //
|
||||
// if (!result)
|
||||
// {
|
||||
// //
|
||||
// isBullish = false;
|
||||
// isBearish = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
// //
|
||||
// // Validate by iBar Pattern ...
|
||||
// // in this Strategy we have PinBar or SignalKeyBar ...
|
||||
// bool validateByBarPatterns = false;
|
||||
// if (result && validateByBarPatterns)
|
||||
// {
|
||||
// //
|
||||
// // Pin ...
|
||||
// bool isPinBar = poiDetector.IsPinnedBar(
|
||||
// iBar,
|
||||
// dir //
|
||||
// );
|
||||
// bool isPinBarBullish =
|
||||
// isPinBar &&
|
||||
// IsXBullish(dir);
|
||||
// bool isPinBarBearish =
|
||||
// isPinBar &&
|
||||
// IsXBearish(dir);
|
||||
|
||||
// //
|
||||
// // Engulfe ...
|
||||
// bool isEngulfed = poiDetector.IsEngulfedBar(
|
||||
// iBar,
|
||||
// dir //
|
||||
// );
|
||||
// bool isEngulfedBullish =
|
||||
// isEngulfed &&
|
||||
// IsXBullish(dir);
|
||||
// bool isEngulfedBearish =
|
||||
// isEngulfed &&
|
||||
// IsXBearish(dir);
|
||||
|
||||
// //
|
||||
// // Signal Key Bar ...
|
||||
// bool isSignalKeyBar = poiDetector.IsSignalKeyBarPattern(
|
||||
// iBar,
|
||||
// dir //
|
||||
// );
|
||||
// bool isSignalKeyBarBullish =
|
||||
// isSignalKeyBar &&
|
||||
// IsXBullish(dir);
|
||||
// bool isSignalKeyBarBearish =
|
||||
// isSignalKeyBar &&
|
||||
// IsXBearish(dir);
|
||||
|
||||
// //
|
||||
// isBullish =
|
||||
// isBullish &&
|
||||
// (isEngulfedBullish);
|
||||
// isBearish =
|
||||
// isBearish &&
|
||||
// (isEngulfedBearish);
|
||||
|
||||
// // //
|
||||
// // isBullish =
|
||||
// // isBullish &&
|
||||
// // (isPinBarBullish ||
|
||||
// // isEngulfedBullish ||
|
||||
// // isSignalKeyBarBullish);
|
||||
// // isBearish =
|
||||
// // isBearish &&
|
||||
// // (isPinBarBearish ||
|
||||
// // isEngulfedBearish ||
|
||||
// // isSignalKeyBarBearish);
|
||||
|
||||
// //
|
||||
// result = isBullish || isBearish;
|
||||
|
||||
// //
|
||||
// if (!result)
|
||||
// {
|
||||
// //
|
||||
// isBullish = false;
|
||||
// isBearish = false;
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// Recent Support ...
|
||||
// else if (HasChild(supports))
|
||||
// {
|
||||
// //
|
||||
// tmpSupportIDX = GetYoungestBelow(iBar.close, supports);
|
||||
// if (IsValidIndex(tmpSupportIDX))
|
||||
// {
|
||||
// zone = supports[tmpSupportIDX];
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// Recent Resistance ...
|
||||
// else if (HasChild(resistances))
|
||||
// {
|
||||
// //
|
||||
// tmpResistanceIDX = GetYoungestAbove(iBar.close, resistances);
|
||||
// if (IsValidIndex(tmpResistanceIDX))
|
||||
// {
|
||||
// zone = resistances[tmpResistanceIDX];
|
||||
// }
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user