This commit is contained in:
2025-02-22 14:28:59 +03:30
parent c876af3f1b
commit 60980ff036
4 changed files with 1998 additions and 611 deletions
+304
View File
@@ -2364,3 +2364,307 @@ bool IsReject(
//
Clean(tmps);
}
//////////////////////////////////////////////////////////
// //
// // Calculate Rejection Values ...
// //
// double fiboUpDown = GetFibonacciLevel(
// iBar.high,
// iBar.low,
// X_FIBO_LEVEL_382,
// X_DIRECTION_BEARISH //
// );
// double fiboDownUp = GetFibonacciLevel(
// iBar.high,
// iBar.low,
// X_FIBO_LEVEL_382,
// X_DIRECTION_BULLISH //
// );
// //
// bool hasFiboToUpPressure =
// fiboDownUp > 0 &&
// fiboDownUp <= iBar.GetDown();
// bool hasFiboToDownPressure =
// fiboUpDown > 0 &&
// fiboUpDown >= iBar.GetUp();
// //
// bool isLongReject =
// //
// iBar.low < iMa &&
// iBar.high >= iMa &&
// iBar.GetDown() >= iMa
// //
// ;
// bool isStrongLongReject =
// iBar.IsBullish() &&
// isLongReject;
// bool isPressuredLongReject =
// isLongReject &&
// hasFiboToUpPressure;
// bool isPressuredStrongLongReject =
// isStrongLongReject &&
// isPressuredLongReject;
// //
// bool isShortReject =
// //
// iBar.high > iMa &&
// iBar.low <= iMa &&
// iBar.GetUp() <= iMa
// //
// ;
// bool isStrongShortReject =
// iBar.IsBearish() &&
// isShortReject;
// bool isPressuredShortReject =
// isShortReject &&
// hasFiboToDownPressure;
// bool isPressuredStrongShortReject =
// isStrongShortReject &&
// isPressuredShortReject;
// //
// double iLongRejectValue = 0;
// double iShortRejectValue = 0;
// //
// bool isAppliedLongReject = false;
// bool isAppliedShortReject = false;
// switch (rejectionType)
// {
// //
// case XWZ_REJECTION_BAR:
// isAppliedLongReject = isLongReject;
// isAppliedShortReject = isShortReject;
// break;
// //
// case XWZ_REJECTION_STRONG_BAR:
// isAppliedLongReject = isStrongLongReject;
// isAppliedShortReject = isStrongShortReject;
// break;
// //
// case XWZ_REJECTION_PRESSURED_BAR:
// isAppliedLongReject = isPressuredLongReject;
// isAppliedShortReject = isPressuredShortReject;
// break;
// //
// case XWZ_REJECTION_STRONG_PRESSURED_BAR:
// isAppliedLongReject = isPressuredStrongLongReject;
// isAppliedShortReject = isPressuredStrongShortReject;
// break;
// }
// //
// // Calculate Rejection Verification Values ...
// //
// int iLLIDX = pBar
// .FindLowestIndex(
// rejectionVerificationLength,
// MODE_LOW //
// );
// datetime iLLTime = iTime(
// _Symbol,
// _Period,
// iLLIDX //
// );
// double iLL = iLow(
// _Symbol,
// _Period,
// iLLIDX //
// );
// //
// int iHHIDX = pBar
// .FindHighestIndex(
// rejectionVerificationLength,
// MODE_HIGH //
// );
// datetime iHHTime = iTime(
// _Symbol,
// _Period,
// iHHIDX //
// );
// double iHH = iHigh(
// _Symbol,
// _Period,
// iHHIDX //
// );
// //
// bool isLLBreaked = false;
// bool isHHBreaked = false;
// if (rejectionVerificationLength > 0)
// {
// //
// for (int i = bar_index + 1; i < bar_index + rejectionVerificationLength; i++)
// {
// //
// double iMaValue = maBuffer[i];
// //
// XOHCL iBar;
// bool isInited = iBar.Init(
// _Symbol,
// _Period,
// i //
// );
// if (!isInited)
// {
// //
// iBar.Clean();
// isLLBreaked = true;
// isHHBreaked = true;
// break;
// }
// //
// if (!isLLBreaked)
// {
// isLLBreaked = iBar.low < iMaValue;
// }
// //
// if (!isHHBreaked)
// {
// isHHBreaked = iBar.high > iMaValue;
// }
// //
// if (isLLBreaked &&
// isHHBreaked)
// {
// break;
// }
// }
// }
// //
// // Validate Rejections ...
// //
// // -[] Before Reject Long, price
// // must not touch Ma from Up for at least 3 Bar ...
// bool isValidAppliedLongReject =
// !isLLBreaked &&
// isAppliedLongReject;
// //
// // -[] Before Reject Short Price
// // must no touch Ma from down at least 3 Bar ...
// bool isValidAppliedShortReject =
// !isHHBreaked &&
// isAppliedShortReject;
// //
// if (isValidAppliedLongReject)
// {
// iLongRejectValue = iBar.low - points10;
// }
// else
// {
// iLongRejectValue = 0;
// }
// //
// if (isValidAppliedShortReject)
// {
// iShortRejectValue = iBar.high + points10;
// }
// else
// {
// iShortRejectValue = 0;
// }
// //
// // Draw Verification Box ...
// if (isValidAppliedLongReject ||
// isValidAppliedShortReject)
// {
// //
// datetime time1 = iTime(
// _Symbol,
// _Period,
// iBar.Index() + rejectionVerificationLength //
// );
// datetime time2 = iTime(
// _Symbol,
// _Period,
// iBar.Index() + 0 //
// );
// string llName = ToString(iLLIDX) + "_" +
// ToString(iLL) + "_" +
// ToMD5(iLLTime);
// CChartObjectTrend *llTrend;
// llTrend = new CChartObjectTrend();
// bool isCreated = llTrend.Create(
// 0,
// llName,
// 0,
// time1,
// iLL,
// time2,
// iLL //
// );
// if (isCreated)
// {
// mXWZDrawnObjects.Add(llTrend);
// }
// //
// string hhName = ToString(iHHIDX) + "_" +
// ToString(iHH) + "_" +
// ToMD5(iHHTime);
// CChartObjectTrend *hhTrend;
// hhTrend = new CChartObjectTrend();
// isCreated = hhTrend.Create(
// 0,
// hhName,
// 0,
// time1,
// iHH,
// time2,
// iHH //
// );
// if (isCreated)
// {
// mXWZDrawnObjects.Add(hhTrend);
// }
// }
// //
// int idx = -1;
// int count = 0;
// bool has = false;
// //
// ENUM_X_DIRECTION trend =
// IsValid(lastBullishTrend) &&
// lastBullishTrend > lastBearishTrend
// ? X_DIRECTION_BULLISH
// : IsValid(lastBearishTrend) &&
// lastBearishTrend > lastBullishTrend
// ? X_DIRECTION_BEARISH
// : X_DIRECTION_NONE;
// bool hasTrend = HasDirection(trend);
// bool hasBullishTrend = hasTrend &&
// IsBullish(trend);
// bool hasBearishTrend = hasTrend &&
// IsBearish(trend);
// //
// // Filling Buffers ...
// //
// longSLBuffer[bar_index] = iLongSL;
// shortSLBuffer[bar_index] = iShortSL;