last ...
This commit is contained in:
@@ -478,6 +478,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
//
|
||||
// XTWPV Signal ...
|
||||
X121SMCStrategyXTWPVSignalConditions mXTWPVConditions;
|
||||
X121SMCStrategyXTWPVSignalConditions mXTWPVConditionsCollection[];
|
||||
bool DetectXTWPVSignal(
|
||||
X121SMCStrategyConditions &conditions //
|
||||
)
|
||||
@@ -489,10 +490,52 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
bool isBullish = false;
|
||||
bool isBearish = false;
|
||||
|
||||
//
|
||||
int zIndex = 0;
|
||||
int cIndex = zIndex + 1;
|
||||
int pIndex = cIndex + 1;
|
||||
int ppIndex = pIndex + 1;
|
||||
|
||||
//
|
||||
string symbol = GetSymbol();
|
||||
ENUM_TIMEFRAMES period = GetPeriod();
|
||||
|
||||
//
|
||||
XOHCL zBar;
|
||||
result = zBar.Init(
|
||||
symbol,
|
||||
period,
|
||||
zIndex //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL cBar;
|
||||
result = cBar.Init(
|
||||
symbol,
|
||||
period,
|
||||
cIndex //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
XOHCL pBar;
|
||||
result = pBar.Init(
|
||||
symbol,
|
||||
period,
|
||||
pIndex //
|
||||
);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
datetime cTime = TimeCurrent();
|
||||
|
||||
@@ -524,81 +567,111 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
//
|
||||
setupDir = mXTWPVConditions.dir;
|
||||
setupTime = mXTWPVConditions.setupTime;
|
||||
}
|
||||
|
||||
//
|
||||
if (isSetuped)
|
||||
{
|
||||
//
|
||||
mXTWPVConditions.UpdateOrderBlocks();
|
||||
|
||||
//
|
||||
XCBaseObject *bullDrawnObjects[];
|
||||
int bullDrawnObjectsCount = mPOIDrawer.DrawFVGOrderBlock(
|
||||
mXTWPVConditions.bullishOrderBlocks,
|
||||
bullDrawnObjects //
|
||||
);
|
||||
if (IsValidSize(bullDrawnObjectsCount))
|
||||
if (isSetuped)
|
||||
{
|
||||
AddObjectsIfNotExists(bullDrawnObjects);
|
||||
}
|
||||
//
|
||||
AddRef(
|
||||
mXTWPVConditions,
|
||||
mXTWPVConditionsCollection);
|
||||
|
||||
//
|
||||
XCBaseObject *bearDrawnObjects[];
|
||||
int bearDrwanObjectsCount = mPOIDrawer.DrawFVGOrderBlock(
|
||||
mXTWPVConditions.bearishOrderBlocks,
|
||||
bearDrawnObjects //
|
||||
);
|
||||
if (IsValidSize(bearDrwanObjectsCount))
|
||||
{
|
||||
AddObjectsIfNotExists(bearDrawnObjects);
|
||||
//
|
||||
mXTWPVConditions.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
result = isSetuped;
|
||||
int conditionsCount = ArraySize(mXTWPVConditionsCollection);
|
||||
result = IsValidSize(conditionsCount);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Trigger Conditions ...
|
||||
bool canTrigger = mXTWPVConditions.CanTrigger();
|
||||
datetime triggerTime = mXTWPVConditions.triggerTime;
|
||||
if (!canTrigger)
|
||||
// Looking For Conditions ...
|
||||
int selectedIndex = 0;
|
||||
X121SMCStrategyXTWPVSignalConditions mConditions;
|
||||
for (int i = 0; i < conditionsCount; i++)
|
||||
{
|
||||
//
|
||||
// Detect Signal Trigger ...
|
||||
canTrigger = DetectX121SMCXTWPVSiganlTrigger(
|
||||
mXTWPVConditions,
|
||||
symbol,
|
||||
period,
|
||||
mTriggerCycleHelper,
|
||||
mDecisionCycleHelper,
|
||||
mAnalyseCycleHelper,
|
||||
mVerificationCycleHelper,
|
||||
mConsolidationCycleHelper,
|
||||
mVisionCycleHelper //
|
||||
);
|
||||
// Update Conditions ...
|
||||
mXTWPVConditionsCollection[i].UpdateOrderBlocks();
|
||||
|
||||
//
|
||||
result = canTrigger;
|
||||
if (!result)
|
||||
// Draw Conditions ...
|
||||
|
||||
//
|
||||
XFVGOrderBlock iFVGOB = mXTWPVConditionsCollection[i].fvgOB;
|
||||
XCBaseObject *drawnObjects[];
|
||||
mPOIDrawer.DrawFVGOrderBlock(
|
||||
iFVGOB,
|
||||
drawnObjects //
|
||||
);
|
||||
AddObjectsIfNotExists(drawnObjects);
|
||||
|
||||
//
|
||||
// Check Triggers ...
|
||||
bool canTrigger = mXTWPVConditionsCollection[i].CanTrigger();
|
||||
datetime triggerTime = mXTWPVConditionsCollection[i].triggerTime;
|
||||
if (!canTrigger)
|
||||
{
|
||||
return result;
|
||||
//
|
||||
// Detect Signal Trigger ...
|
||||
canTrigger = DetectX121SMCXTWPVSiganlTrigger(
|
||||
mXTWPVConditionsCollection[i],
|
||||
symbol,
|
||||
period,
|
||||
mTriggerCycleHelper,
|
||||
mDecisionCycleHelper,
|
||||
mAnalyseCycleHelper,
|
||||
mVerificationCycleHelper,
|
||||
mConsolidationCycleHelper,
|
||||
mVisionCycleHelper //
|
||||
);
|
||||
|
||||
//
|
||||
result = canTrigger;
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
triggerTime = mXTWPVConditionsCollection[i].triggerTime;
|
||||
}
|
||||
|
||||
//
|
||||
triggerTime = mXTWPVConditions.triggerTime;
|
||||
if (canTrigger)
|
||||
{
|
||||
//
|
||||
selectedIndex = i;
|
||||
mConditions = mXTWPVConditionsCollection[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check Signal Direction ...
|
||||
result = IsValid(mConditions.setupTime) &&
|
||||
HasDirection(mConditions.dir);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
isBullish = IsBullish(setupDir);
|
||||
isBearish = IsBearish(setupDir);
|
||||
// Remove Selected Index from Main Collection ...
|
||||
ArrayRemove(
|
||||
mXTWPVConditionsCollection,
|
||||
selectedIndex,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
// Check Signal Direction ...
|
||||
isBullish = IsBullish(mConditions.dir);
|
||||
isBearish = IsBearish(mConditions.dir);
|
||||
result = isBullish ||
|
||||
isBearish;
|
||||
if (!result)
|
||||
@@ -608,26 +681,10 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// Issues Signal on Conditions ...
|
||||
conditions.signalDir = setupDir;
|
||||
conditions.sl = mConditions.sl;
|
||||
conditions.provider = providerStr;
|
||||
conditions.sl = mXTWPVConditions.sl;
|
||||
conditions.target = mXTWPVConditions.target;
|
||||
|
||||
//
|
||||
// TODO: Remove ...
|
||||
// conditions.decisionZones = mXTWPVConditions.decisionZone;
|
||||
// conditions.marketStructure = mXTWPVConditions.analyseMarketStructure;
|
||||
// if (isBullish)
|
||||
// {
|
||||
// conditions.priceZones = mXTWPVConditions.valePriceZone;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// conditions.priceZones = mXTWPVConditions.peakPriceZone;
|
||||
// }
|
||||
|
||||
//
|
||||
mXTWPVConditions.Clean();
|
||||
conditions.signalDir = mConditions.dir;
|
||||
conditions.target = mConditions.target;
|
||||
|
||||
//
|
||||
return result;
|
||||
@@ -685,7 +742,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
x121Inputs.Default();
|
||||
|
||||
//
|
||||
x121Inputs.showRSI = false;
|
||||
x121Inputs.showRSI = true;
|
||||
|
||||
//
|
||||
bool isInited = false;
|
||||
@@ -710,14 +767,14 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// XATR ...
|
||||
x121Inputs.xatrInputs.showATRUpper = true;
|
||||
x121Inputs.xatrInputs.showATRLower = true;
|
||||
x121Inputs.xatrInputs.showATRUpper = false;
|
||||
x121Inputs.xatrInputs.showATRLower = false;
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
x121Inputs.xstrInputs.showStr = true;
|
||||
x121Inputs.xstrInputs.showStrUpper = true;
|
||||
x121Inputs.xstrInputs.showStrLower = true;
|
||||
x121Inputs.xstrInputs.showStrUpper = false;
|
||||
x121Inputs.xstrInputs.showStrLower = false;
|
||||
|
||||
//
|
||||
// XDON ...
|
||||
@@ -729,7 +786,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
//
|
||||
// XVWAP ...
|
||||
x121Inputs.xvwapInputs.showVWapFast = false;
|
||||
x121Inputs.xvwapInputs.showVWapFast = false;
|
||||
x121Inputs.xvwapInputs.showVWapMedium = false;
|
||||
x121Inputs.xvwapInputs.showVWapSlow = false;
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user