1412 lines
53 KiB
Plaintext
1412 lines
53 KiB
Plaintext
// // 4H ...
|
|
// int orderBlocksCount = ArraySize(h4State.bearishOrderBlocks);
|
|
// if (IsValidSize(orderBlocksCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < orderBlocksCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jZone = h4State.bearishOrderBlocks[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jZone,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jZone.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jZone,
|
|
// conditions.bearishOrderBlocks //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// orderBlocksCount = ArraySize(m15State.bearishOrderBlocks);
|
|
// if (IsValidSize(orderBlocksCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < orderBlocksCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jZone = m15State.bearishOrderBlocks[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jZone,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jZone.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jZone,
|
|
// conditions.bearishOrderBlocks //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// orderBlocksCount = ArraySize(m5State.bearishOrderBlocks);
|
|
// if (IsValidSize(orderBlocksCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < orderBlocksCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jZone = m5State.bearishOrderBlocks[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jZone,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jZone.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jZone,
|
|
// conditions.bearishOrderBlocks //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// orderBlocksCount = ArraySize(m1State.bearishOrderBlocks);
|
|
// if (IsValidSize(orderBlocksCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < orderBlocksCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jZone = m1State.bearishOrderBlocks[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jZone,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jZone.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jZone,
|
|
// conditions.bearishOrderBlocks //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// // 4H ...
|
|
// int resistancesCount = ArraySize(h4State.resistanceZones);
|
|
// if (IsValidSize(resistancesCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < resistancesCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = h4State.resistanceZones[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.resistances //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// resistancesCount = ArraySize(m15State.resistanceZones);
|
|
// if (IsValidSize(resistancesCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < resistancesCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m15State.resistanceZones[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.resistances //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// resistancesCount = ArraySize(m5State.resistanceZones);
|
|
// if (IsValidSize(resistancesCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < resistancesCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m5State.resistanceZones[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.resistances //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// resistancesCount = ArraySize(m1State.resistanceZones);
|
|
// if (IsValidSize(resistancesCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < resistancesCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m1State.resistanceZones[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.resistances //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// // 4H ...
|
|
// int fvgsCount = ArraySize(h4State.bearishFVGs);
|
|
// if (IsValidSize(fvgsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < fvgsCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jFVG = h4State.bearishFVGs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jFVG,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jFVG.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jFVG,
|
|
// conditions.bearishFVGs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// fvgsCount = ArraySize(m15State.bearishFVGs);
|
|
// if (IsValidSize(fvgsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < fvgsCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jFVG = m15State.bearishFVGs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jFVG,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jFVG.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jFVG,
|
|
// conditions.bearishFVGs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// fvgsCount = ArraySize(m5State.bearishFVGs);
|
|
// if (IsValidSize(fvgsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < fvgsCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jFVG = m5State.bearishFVGs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jFVG,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jFVG.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jFVG,
|
|
// conditions.bearishFVGs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// fvgsCount = ArraySize(m1State.bearishFVGs);
|
|
// if (IsValidSize(fvgsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < fvgsCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jFVG = m1State.bearishFVGs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jFVG,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jFVG.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jFVG,
|
|
// conditions.bearishFVGs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// // 4H ...
|
|
// int swingsCount = ArraySize(h4State.swingHighs);
|
|
// if (IsValidSize(swingsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < swingsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = h4State.swingHighs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.swingHighs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// swingsCount = ArraySize(m15State.swingHighs);
|
|
// if (IsValidSize(swingsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < swingsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m15State.swingHighs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.swingHighs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// swingsCount = ArraySize(m5State.swingHighs);
|
|
// if (IsValidSize(swingsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < swingsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m5State.swingHighs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.swingHighs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// swingsCount = ArraySize(m1State.swingHighs);
|
|
// if (IsValidSize(swingsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < swingsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m1State.swingHighs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.swingHighs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
// // 4H ...
|
|
// int momentumBarsCount = ArraySize(h4State.momentumBars);
|
|
// if (IsValidSize(momentumBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < momentumBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = h4State.momentumBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.IsBearish() &&
|
|
// jBar.time > iSupplyZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bearishMomentumBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// momentumBarsCount = ArraySize(m15State.momentumBars);
|
|
// if (IsValidSize(momentumBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < momentumBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m15State.momentumBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.IsBearish() &&
|
|
// jBar.time > iSupplyZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bearishMomentumBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// momentumBarsCount = ArraySize(m5State.momentumBars);
|
|
// if (IsValidSize(momentumBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < momentumBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m5State.momentumBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.IsBearish() &&
|
|
// jBar.time > iSupplyZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bearishMomentumBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// momentumBarsCount = ArraySize(m1State.momentumBars);
|
|
// if (IsValidSize(momentumBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < momentumBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m1State.momentumBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.IsBearish() &&
|
|
// jBar.time > iSupplyZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bearishMomentumBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// // 4H ...
|
|
// int rejectionBarsCount = ArraySize(h4State.rejectionBars);
|
|
// if (IsValidSize(rejectionBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < rejectionBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = h4State.rejectionBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.GetLowShadow() < jBar.GetHighShadow() &&
|
|
// jBar.time > iSupplyZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bearishRejectionBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// rejectionBarsCount = ArraySize(m15State.rejectionBars);
|
|
// if (IsValidSize(rejectionBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < rejectionBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m15State.rejectionBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.GetLowShadow() < jBar.GetHighShadow() &&
|
|
// jBar.time > iSupplyZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bearishRejectionBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// rejectionBarsCount = ArraySize(m5State.rejectionBars);
|
|
// if (IsValidSize(rejectionBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < rejectionBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m5State.rejectionBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.GetLowShadow() < jBar.GetHighShadow() &&
|
|
// jBar.time > iSupplyZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bearishRejectionBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// rejectionBarsCount = ArraySize(m1State.rejectionBars);
|
|
// if (IsValidSize(rejectionBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < rejectionBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m1State.rejectionBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.GetLowShadow() < jBar.GetHighShadow() &&
|
|
// jBar.time > iSupplyZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iSupplyZone,
|
|
// X_ZONE_UPPER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bearishRejectionBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
// // 4H ...
|
|
// int orderBlocksCount = ArraySize(h4State.bullishOrderBlocks);
|
|
// if (IsValidSize(orderBlocksCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < orderBlocksCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jZone = h4State.bullishOrderBlocks[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jZone,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jZone.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jZone,
|
|
// conditions.bullishOrderBlocks //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// orderBlocksCount = ArraySize(m15State.bullishOrderBlocks);
|
|
// if (IsValidSize(orderBlocksCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < orderBlocksCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jZone = m15State.bullishOrderBlocks[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jZone,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jZone.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jZone,
|
|
// conditions.bullishOrderBlocks //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// orderBlocksCount = ArraySize(m5State.bullishOrderBlocks);
|
|
// if (IsValidSize(orderBlocksCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < orderBlocksCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jZone = m5State.bullishOrderBlocks[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jZone,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jZone.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jZone,
|
|
// conditions.bullishOrderBlocks //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// orderBlocksCount = ArraySize(m1State.bullishOrderBlocks);
|
|
// if (IsValidSize(orderBlocksCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < orderBlocksCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jZone = m1State.bullishOrderBlocks[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jZone,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jZone.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jZone,
|
|
// conditions.bullishOrderBlocks //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
// // 4H ...
|
|
// int supportsCount = ArraySize(h4State.supportZones);
|
|
// if (IsValidSize(supportsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < supportsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = h4State.supportZones[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.supports //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// supportsCount = ArraySize(m15State.supportZones);
|
|
// if (IsValidSize(supportsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < supportsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m15State.supportZones[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.supports //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// supportsCount = ArraySize(m5State.supportZones);
|
|
// if (IsValidSize(supportsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < supportsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m5State.supportZones[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.supports //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// supportsCount = ArraySize(m1State.supportZones);
|
|
// if (IsValidSize(supportsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < supportsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m1State.supportZones[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.supports //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
// // 4H ...
|
|
// int fvgsCount = ArraySize(h4State.bullishFVGs);
|
|
// if (IsValidSize(fvgsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < fvgsCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jFVG = h4State.bullishFVGs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jFVG,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jFVG.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jFVG,
|
|
// conditions.bullishFVGs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// fvgsCount = ArraySize(m15State.bullishFVGs);
|
|
// if (IsValidSize(fvgsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < fvgsCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jFVG = m15State.bullishFVGs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jFVG,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jFVG.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jFVG,
|
|
// conditions.bullishFVGs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// fvgsCount = ArraySize(m5State.bullishFVGs);
|
|
// if (IsValidSize(fvgsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < fvgsCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jFVG = m5State.bullishFVGs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jFVG,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jFVG.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jFVG,
|
|
// conditions.bullishFVGs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// fvgsCount = ArraySize(m1State.bullishFVGs);
|
|
// if (IsValidSize(fvgsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < fvgsCount; j++)
|
|
// {
|
|
// //
|
|
// XZone jFVG = m1State.bullishFVGs[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jFVG,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// jFVG.to = TimeCurrent();
|
|
|
|
// //
|
|
// AddIfNotExists(
|
|
// jFVG,
|
|
// conditions.bullishFVGs //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
// // 4H ...
|
|
// int swingsCount = ArraySize(h4State.swingLows);
|
|
// if (IsValidSize(swingsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < swingsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = h4State.swingLows[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.swingLows //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// swingsCount = ArraySize(m15State.swingLows);
|
|
// if (IsValidSize(swingsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < swingsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m15State.swingLows[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.swingLows //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// swingsCount = ArraySize(m5State.swingLows);
|
|
// if (IsValidSize(swingsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < swingsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m5State.swingLows[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.swingLows //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// swingsCount = ArraySize(m1State.swingLows);
|
|
// if (IsValidSize(swingsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < swingsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m1State.swingLows[j];
|
|
|
|
// //
|
|
// bool isInside = IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.swingLows //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
// // 4H ...
|
|
// int momentumBarsCount = ArraySize(h4State.momentumBars);
|
|
// if (IsValidSize(momentumBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < momentumBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = h4State.momentumBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.IsBullish() &&
|
|
// jBar.time > iDemandZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bullishMomentumBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// momentumBarsCount = ArraySize(m15State.momentumBars);
|
|
// if (IsValidSize(momentumBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < momentumBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m15State.momentumBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.IsBullish() &&
|
|
// jBar.time > iDemandZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bullishMomentumBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// momentumBarsCount = ArraySize(m5State.momentumBars);
|
|
// if (IsValidSize(momentumBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < momentumBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m5State.momentumBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.IsBullish() &&
|
|
// jBar.time > iDemandZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bullishMomentumBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// momentumBarsCount = ArraySize(m1State.momentumBars);
|
|
// if (IsValidSize(momentumBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < momentumBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m1State.momentumBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.IsBullish() &&
|
|
// jBar.time > iDemandZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bullishMomentumBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
|
|
// // 4H ...
|
|
// int rejectionBarsCount = ArraySize(h4State.rejectionBars);
|
|
// if (IsValidSize(rejectionBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < rejectionBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = h4State.rejectionBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.GetLowShadow() > jBar.GetHighShadow() &&
|
|
// jBar.time > iDemandZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bullishRejectionBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 15M ...
|
|
// rejectionBarsCount = ArraySize(m15State.rejectionBars);
|
|
// if (IsValidSize(rejectionBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < rejectionBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m15State.rejectionBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.GetLowShadow() > jBar.GetHighShadow() &&
|
|
// jBar.time > iDemandZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bullishRejectionBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 5M ...
|
|
// rejectionBarsCount = ArraySize(m5State.rejectionBars);
|
|
// if (IsValidSize(rejectionBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < rejectionBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m5State.rejectionBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.GetLowShadow() > jBar.GetHighShadow() &&
|
|
// jBar.time > iDemandZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bullishRejectionBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|
|
// // 1M ...
|
|
// rejectionBarsCount = ArraySize(m1State.rejectionBars);
|
|
// if (IsValidSize(rejectionBarsCount))
|
|
// {
|
|
// //
|
|
// for (int j = 0; j < rejectionBarsCount; j++)
|
|
// {
|
|
// //
|
|
// XOHCL jBar = m1State.rejectionBars[j];
|
|
|
|
// //
|
|
// bool isInside =
|
|
// jBar.GetLowShadow() > jBar.GetHighShadow() &&
|
|
// jBar.time > iDemandZone.from &&
|
|
// IsInside(
|
|
// jBar,
|
|
// iDemandZone,
|
|
// X_ZONE_LOWER_EDGE,
|
|
// true //
|
|
// );
|
|
// if (isInside)
|
|
// {
|
|
// //
|
|
// AddIfNotExists(
|
|
// jBar,
|
|
// conditions.bullishRejectionBars //
|
|
// );
|
|
// }
|
|
// }
|
|
// }
|