215 lines
5.6 KiB
Plaintext
215 lines
5.6 KiB
Plaintext
//
|
|
// Draw Last Sar Change ...
|
|
string iVLineName = sarChangeBar.GetTag("XSAR");
|
|
CChartObjectVLine *iVLineObj;
|
|
iVLineObj = new CChartObjectVLine();
|
|
result = iVLineObj.Create(
|
|
ChartID(),
|
|
iVLineName,
|
|
0,
|
|
sarChangeBar.time //
|
|
);
|
|
if (result)
|
|
{
|
|
iVLineObj.Color(clrYellow);
|
|
}
|
|
|
|
|
|
|
|
//
|
|
// Draw Last Decision Bar ...
|
|
string iVLineNameDecision = decisionBar.GetTag("XDECISION");
|
|
CChartObjectVLine *iVLineDecisionObj;
|
|
iVLineDecisionObj = new CChartObjectVLine();
|
|
result = iVLineDecisionObj.Create(
|
|
ChartID(),
|
|
iVLineNameDecision,
|
|
0,
|
|
decisionBar.time //
|
|
);
|
|
if (result)
|
|
{
|
|
iVLineDecisionObj.Color(clrYellow);
|
|
}
|
|
|
|
|
|
//
|
|
// Draw Breaker Bar ...
|
|
string iVLineNameBreaker = breakerBar.GetTag("XBREAKER");
|
|
CChartObjectVLine *iVLineBreakerObj;
|
|
iVLineBreakerObj = new CChartObjectVLine();
|
|
result = iVLineBreakerObj.Create(
|
|
ChartID(),
|
|
iVLineNameBreaker,
|
|
0,
|
|
breakerBar.time //
|
|
);
|
|
if (result)
|
|
{
|
|
iVLineBreakerObj.Color(clrMagenta);
|
|
}
|
|
|
|
|
|
|
|
//
|
|
// TODO: Remove This ...
|
|
bool ignoreSwingHighs = true;
|
|
bool ignoreSwingLows = true;
|
|
bool ignoreSupportZones = true;
|
|
bool ignoreResistanceZones = true;
|
|
bool ignoreSupplyZones = true;
|
|
bool ignoreDemandZones = true;
|
|
bool ignoreBullishOrderBlocks = true;
|
|
bool ignoreBearishOrderBlocks = true;
|
|
bool ignoreBullishFairValueGaps = true;
|
|
bool ignoreBearishFairValueGaps = true;
|
|
bool ignoreBullishRejectionBars = true;
|
|
bool ignoreBearishRejectionBars = true;
|
|
bool ignoreBullishMomentumBars = true;
|
|
bool ignoreBearishMomentumBars = true;
|
|
|
|
//
|
|
if (IsBullish(marketStructureDir))
|
|
{
|
|
//
|
|
ignoreSwingLows = true;
|
|
ignoreSupportZones = true;
|
|
ignoreDemandZones = true;
|
|
ignoreBullishOrderBlocks = true;
|
|
ignoreBullishFairValueGaps = false;
|
|
ignoreBullishRejectionBars = false;
|
|
ignoreBullishMomentumBars = false;
|
|
|
|
//
|
|
ignoreSwingHighs = true;
|
|
ignoreResistanceZones = true;
|
|
ignoreSupplyZones = true;
|
|
ignoreBearishOrderBlocks = true;
|
|
ignoreBearishFairValueGaps = true;
|
|
ignoreBearishRejectionBars = true;
|
|
ignoreBearishMomentumBars = true;
|
|
}
|
|
else
|
|
{
|
|
//
|
|
ignoreSwingLows = true;
|
|
ignoreSupportZones = true;
|
|
ignoreDemandZones = true;
|
|
ignoreBullishOrderBlocks = true;
|
|
ignoreBullishFairValueGaps = true;
|
|
ignoreBullishRejectionBars = true;
|
|
ignoreBullishMomentumBars = true;
|
|
|
|
//
|
|
ignoreSwingHighs = true;
|
|
ignoreResistanceZones = true;
|
|
ignoreSupplyZones = true;
|
|
ignoreBearishOrderBlocks = true;
|
|
ignoreBearishFairValueGaps = false;
|
|
ignoreBearishRejectionBars = false;
|
|
ignoreBearishMomentumBars = false;
|
|
}
|
|
|
|
//
|
|
RedrawOrderFlow(
|
|
true, // Force Clean ...
|
|
false, // Same Period ...
|
|
true, // Order Flow ...
|
|
true, // Order Flow State ...
|
|
false, // Only Last Order Flow ...
|
|
true, // Only Last Order Flow State ...
|
|
//
|
|
marketStructureDir, // Direction Force ...
|
|
ignoreSwingHighs,
|
|
ignoreSwingLows,
|
|
ignoreSupportZones,
|
|
ignoreResistanceZones,
|
|
ignoreSupplyZones,
|
|
ignoreDemandZones,
|
|
ignoreBullishOrderBlocks,
|
|
ignoreBearishOrderBlocks,
|
|
ignoreBullishFairValueGaps,
|
|
ignoreBearishFairValueGaps,
|
|
ignoreBullishRejectionBars,
|
|
ignoreBearishRejectionBars,
|
|
ignoreBullishMomentumBars,
|
|
ignoreBearishMomentumBars //
|
|
);
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
/**
|
|
* Validate an Order Block is Not Touched ...
|
|
*
|
|
* @param bar: XOHCL instance, start bar ...
|
|
*
|
|
* @return ( bool )
|
|
*/
|
|
bool ValidateOrderBlock(
|
|
XCOrderBlock *ob,
|
|
XOHCL &bar //
|
|
)
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
result =
|
|
bar.IsValid() &&
|
|
ob.IsValid();
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
bool isBullish = ob.IsBullish();
|
|
|
|
//
|
|
XOHCL mBar;
|
|
result = bar.BarIn(ob.GetPeriod(), mBar);
|
|
if (!result) {
|
|
return result;
|
|
}
|
|
|
|
//
|
|
int start = mBar.Index();
|
|
int end = mBar.Index(ob.From());
|
|
result = IsValidIndex(start) &&
|
|
IsValidIndex(end);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
for (int i = start; i < end; i++)
|
|
{
|
|
//
|
|
XOHCL iBar;
|
|
result = mBar.BarAt(
|
|
i,
|
|
iBar //
|
|
);
|
|
if (!result)
|
|
{
|
|
break;
|
|
}
|
|
|
|
//
|
|
result =
|
|
isBullish
|
|
? iBar.low > ob.Upper()
|
|
: iBar.high < ob.Lower();
|
|
if (!result)
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|