141 lines
3.4 KiB
Plaintext
141 lines
3.4 KiB
Plaintext
|
|
//
|
|
XSCZones *mLastHindZones;
|
|
XSCZones *mLastLongZones;
|
|
XSCZones *mLastMediumZones;
|
|
|
|
//
|
|
bool DoEQMProtectOfSupports()
|
|
{
|
|
//
|
|
bool result = false;
|
|
|
|
//
|
|
// The Senario is When all Signals are Support and Account in Drawdown
|
|
// here we have to Do some Support Actions ...
|
|
|
|
//
|
|
XPosition positions[];
|
|
int positionsCount = mTrader.GetPositions(positions);
|
|
result = IsValidSize(positionsCount);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Noe We Have to Separate Support Positions ...
|
|
XPosition supports[];
|
|
int supportsCount = ExtractSupportPositions(
|
|
positions,
|
|
supports //
|
|
);
|
|
result = IsValidSize(supportsCount);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Now We Are sure we have Support Positions ...
|
|
// then we must Check the Supports are Long enough to make the Support ...
|
|
XPosition youngest;
|
|
int youngestAge = GetYoungest(
|
|
youngest,
|
|
supports //
|
|
);
|
|
result = youngestAge > 2;
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Try to Find Youngest Support's Setup ...
|
|
int setupIDX = FindSetupIndex(
|
|
youngest.symbol //
|
|
);
|
|
result = IsValidIndex(setupIDX);
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
// Now we can Implememnt Support of Supports based on
|
|
// Several Senarios ...
|
|
// 1. Recieve Market Conditions;
|
|
// 2. Recieve Summary of Long Verifications and Short Verifications;
|
|
// 3. Collect VolumeOSC and also Bullish and Bearish Scores;
|
|
// 4. Collect XSCZones of Last HIND Market;
|
|
|
|
//
|
|
// Hind Zone ...
|
|
if (mLastHindZones == NULL)
|
|
{
|
|
//
|
|
mLastHindZones = mSetups[setupIDX].GetZones(
|
|
X_MARKET_CYCLE_HIND //
|
|
);
|
|
result = mLastHindZones != NULL;
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = mLastHindZones.DrawZones(0, "HIN");
|
|
if (result)
|
|
{
|
|
Print("Zone Drawn ...");
|
|
}
|
|
}
|
|
|
|
//
|
|
// Long Zone ...
|
|
if (mLastLongZones == NULL)
|
|
{
|
|
//
|
|
mLastLongZones = mSetups[setupIDX].GetZones(
|
|
X_MARKET_CYCLE_LONG //
|
|
);
|
|
result = mLastLongZones != NULL;
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = mLastLongZones.DrawZones(0, "LON");
|
|
if (result)
|
|
{
|
|
Print("Zone Drawn ...");
|
|
}
|
|
}
|
|
|
|
//
|
|
// Medium Zone ...
|
|
if (mLastMediumZones == NULL)
|
|
{
|
|
//
|
|
mLastMediumZones = mSetups[setupIDX].GetZones(
|
|
X_MARKET_CYCLE_MEDIUM //
|
|
);
|
|
result = mLastMediumZones != NULL;
|
|
if (!result)
|
|
{
|
|
return result;
|
|
}
|
|
|
|
//
|
|
result = mLastMediumZones.DrawZones(0, "MED");
|
|
if (result)
|
|
{
|
|
Print("Zone Drawn ...");
|
|
}
|
|
}
|
|
|
|
//
|
|
return result;
|
|
}
|