cleanup workspace and backup unused strategies ...

This commit is contained in:
2025-01-25 03:53:32 +03:30
parent 416d3c4a04
commit 2734acf02d
10 changed files with 3202 additions and 822 deletions
+132
View File
@@ -595,3 +595,135 @@ int DrawX121SMCStrategyConditions(
// ? conditions.pivotZone.upper // ? conditions.pivotZone.upper
// : conditions.pivotZone.lower; // : conditions.pivotZone.lower;
} }
/////////////////////////////////////////////////////////////////////////
//
// DRAW ...
//
//
XCBaseObject *drawnObjects[];
//
if (hasBullishOrderBlocks)
{
//
for (int i = 0; i < bullishOrderBlocksCount; i++)
{
//
XCOrderBlock *iOb = conditions.bullishOBs[i];
//
XCBullishOrderBlockObject *iObObj;
bool isCreated = visionCycleHelper
.mPOIDrawer
.CreateBullishOrderBlock(
iOb,
iObObj //
);
if (isCreated)
{
//
Add(
(XCBaseObject *)iObObj,
drawnObjects //
);
}
}
}
//
if (hasBearishOrderBlocks)
{
//
for (int i = 0; i < bearishOrderBlocksCount; i++)
{
//
XCOrderBlock *iOb = conditions.bearishOBs[i];
//
XCBearishOrderBlockObject *iObObj;
bool isCreated = visionCycleHelper
.mPOIDrawer
.CreateBearishOrderBlock(
iOb,
iObObj //
);
if (isCreated)
{
//
Add(
(XCBaseObject *)iObObj,
drawnObjects //
);
}
}
}
//
// if (hasOldestBullishOB)
// {
// //
// XCBullishOrderBlockObject *iObj;
// bool isCreated = visionCycleHelper
// .mPOIDrawer
// .CreateBullishOrderBlock(
// oldestBullishOB,
// iObj //
// );
// if (isCreated)
// {
// }
// }
// //
// if (hasYoungestBullishOB)
// {
// //
// XCBullishOrderBlockObject *iObj;
// bool isCreated = visionCycleHelper
// .mPOIDrawer
// .CreateBullishOrderBlock(
// youngestBullishOB,
// iObj //
// );
// if (isCreated)
// {
// }
// }
// //
// if (hasOldestBearishOB)
// {
// //
// XCBearishOrderBlockObject *iObj;
// bool isCreated = visionCycleHelper
// .mPOIDrawer
// .CreateBearishOrderBlock(
// oldestBearishOB,
// iObj //
// );
// if (isCreated)
// {
// }
// }
// //
// if (hasYoungestBearishOB)
// {
// //
// XCBearishOrderBlockObject *iObj;
// bool isCreated = visionCycleHelper
// .mPOIDrawer
// .CreateBearishOrderBlock(
// youngestBearishOB,
// iObj //
// );
// if (isCreated)
// {
// }
// }
/////////////////////////////////////////////////////////////////////////
File diff suppressed because it is too large Load Diff
+6 -39
View File
@@ -36,10 +36,7 @@ const string X121SMCStrategyToken = "X121SMC";
// //
const string X121SMCXToken = "X121X"; const string X121SMCXToken = "X121X";
const string X121SMCXPZToken = "X121XPZ"; const string X121SMCXOBPVToken = "X121XOBPV";
const string X121SMCXPVTToken = "X121XPVT";
const string X121SMCXRSPVIToken = "X121XRSPVI";
const string X121SMCXSTRPVToken = "X121XSTRPV";
// //
// X121 SMC Providers ... // X121 SMC Providers ...
@@ -48,10 +45,7 @@ enum ENUM_X_121_SMC_PROVIDERS
// //
X_121_SMC_PROVIDER_NONE, X_121_SMC_PROVIDER_NONE,
X_121_SMC_PROVIDER_X, X_121_SMC_PROVIDER_X,
X_121_SMC_PROVIDER_XPZ, X_121_SMC_PROVIDER_XOBPV,
X_121_SMC_PROVIDER_XPVT,
X_121_SMC_PROVIDER_XRSPVI,
X_121_SMC_PROVIDER_XSTRPV,
}; };
// //
@@ -711,23 +705,8 @@ string ToString(ENUM_X_121_SMC_PROVIDERS value)
break; break;
// //
case X_121_SMC_PROVIDER_XPZ: case X_121_SMC_PROVIDER_XOBPV:
result = X121SMCXPZToken; result = X121SMCXOBPVToken;
break;
//
case X_121_SMC_PROVIDER_XPVT:
result = X121SMCXPVTToken;
break;
//
case X_121_SMC_PROVIDER_XRSPVI:
result = X121SMCXRSPVIToken;
break;
//
case X_121_SMC_PROVIDER_XSTRPV:
result = X121SMCXSTRPVToken;
break; break;
} }
@@ -758,21 +737,9 @@ ENUM_X_121_SMC_PROVIDERS ParseProvider(string value)
{ {
result = X_121_SMC_PROVIDER_X; result = X_121_SMC_PROVIDER_X;
} }
else if (Contains(X121SMCXPZToken, value)) else if (Contains(X121SMCXOBPVToken, value))
{ {
result = X_121_SMC_PROVIDER_XPZ; result = X_121_SMC_PROVIDER_XOBPV;
}
else if (Contains(X121SMCXPVTToken, value))
{
result = X_121_SMC_PROVIDER_XPVT;
}
else if (Contains(X121SMCXRSPVIToken, value))
{
result = X_121_SMC_PROVIDER_XRSPVI;
}
else if (Contains(X121SMCXSTRPVToken, value))
{
result = X_121_SMC_PROVIDER_XSTRPV;
} }
// //
+2 -2
View File
@@ -219,7 +219,7 @@ X121SMCStrategyXSignalConditions mXConditionsCollection[];
// //
// Detect Setup Conditions ... // Detect Setup Conditions ...
bool DetectX121SMCXSiganlSetup( bool DetectX121SMCXSignalSetup(
string _symbol, string _symbol,
ENUM_TIMEFRAMES _period, ENUM_TIMEFRAMES _period,
// //
@@ -1310,7 +1310,7 @@ bool DetectX121SMCXSiganlSetup(
// //
// Detect Trigger Conditions ... // Detect Trigger Conditions ...
bool DetectX121SMCXSiganlTrigger( bool DetectX121SMCXSignalTrigger(
// //
X121SMCStrategyXSignalConditions &conditions, X121SMCStrategyXSignalConditions &conditions,
// //
File diff suppressed because it is too large Load Diff
+36 -781
View File
@@ -28,10 +28,7 @@
// //
#include "../Signals/x-121.smc.x.signal.lib.mq5" #include "../Signals/x-121.smc.x.signal.lib.mq5"
#include "../Signals/x-121.smc.xpvt.signal.lib.mq5" #include "../Signals/x-121.smc.xobpv.signal.lib.mq5"
#include "../Signals/x-121.smc.xpz.signal.lib.mq5"
#include "../Signals/x-121.smc.xrspvi.signal.lib.mq5"
#include "../Signals/x-121.smc.xstrpv.signal.lib.mq5"
// //
// Definitions ... // Definitions ...
@@ -46,10 +43,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// Props ... // Props ...
bool useXSignal; bool useXSignal;
bool useXPZSignal; bool useXOBPVSignal;
bool useXPVTSignal;
bool useXRSPVISignal;
bool useXSTRPVSignal;
// //
// Constructor(s) ... // Constructor(s) ...
@@ -72,9 +66,8 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
Destroy(); Destroy();
// //
ArrayFree(mXPZConditionsCollection); ArrayFree(mXConditionsCollection);
ArrayFree(mXRSPVIConditionsCollection); ArrayFree(mXOBPVConditionsCollection);
ArrayFree(mXSTRPVConditionsCollection);
} }
// //
@@ -201,10 +194,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
bool hasXSignal = false; bool hasXSignal = false;
bool hasXPZSignal = false; bool hasXOBPVSignal = false;
bool hasXPVTSignal = false;
bool hasXRSPVISignal = false;
bool hasXSTRPVSignal = false;
// //
// X Signal ... // X Signal ...
@@ -216,39 +206,12 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
} }
// //
// XPZ Signal ... // XOBPV Signal ...
if (useXPZSignal && !hasSignal) if (useXOBPVSignal && !hasSignal)
{ {
// //
hasXPZSignal = DetectXPZSignal(conditions); hasXOBPVSignal = DetectXOBPVSignal(conditions);
hasSignal = hasXPZSignal; hasSignal = hasXOBPVSignal;
}
//
// XPVT Signal ...
if (useXPVTSignal && !hasSignal)
{
//
hasXPVTSignal = DetectXPVTSignal(conditions);
hasSignal = hasXPVTSignal;
}
//
// XRSPVI Signal ...
if (useXRSPVISignal && !hasSignal)
{
//
hasXRSPVISignal = DetectXRSPVISignal(conditions);
hasSignal = hasXRSPVISignal;
}
//
// XSTRPV Signal ...
if (useXSTRPVSignal && !hasSignal)
{
//
hasXSTRPVSignal = DetectXSTRPVSignal(conditions);
hasSignal = hasXSTRPVSignal;
} }
// //
@@ -425,61 +388,10 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// XPZ Guard Detection ... // XPZ Guard Detection ...
if (useXPZSignal) if (useXOBPVSignal)
{ {
// //
bool hasGuard = DetectX121SMCXPZGuards( bool hasGuard = DetectX121SMCXOBPVGuards(
guards,
positions,
mTriggerCycleHelper,
mDecisionCycleHelper,
mAnalyseCycleHelper,
mVerificationCycleHelper,
mConsolidationCycleHelper,
mVisionCycleHelper //
);
}
//
// XPVT Guard Detection ...
if (useXPVTSignal)
{
//
bool hasGuard = DetectX121SMCXPVTGuards(
guards,
positions,
mTriggerCycleHelper,
mDecisionCycleHelper,
mAnalyseCycleHelper,
mVerificationCycleHelper,
mConsolidationCycleHelper,
mVisionCycleHelper //
);
}
//
// XSTRPV Guard Detection ...
if (useXSTRPVSignal)
{
//
bool hasGuard = DetectX121SMCXSTRPVGuards(
guards,
positions,
mTriggerCycleHelper,
mDecisionCycleHelper,
mAnalyseCycleHelper,
mVerificationCycleHelper,
mConsolidationCycleHelper,
mVisionCycleHelper //
);
}
//
// XRSPVI Guard Detection ...
if (useXRSPVISignal)
{
//
bool hasGuard = DetectX121SMCXRSPVIGuards(
guards, guards,
positions, positions,
mTriggerCycleHelper, mTriggerCycleHelper,
@@ -608,7 +520,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
{ {
// //
// Detect Signal Setup ... // Detect Signal Setup ...
isSetuped = DetectX121SMCXSiganlSetup( isSetuped = DetectX121SMCXSignalSetup(
symbol, symbol,
period, period,
mXConditions, mXConditions,
@@ -682,7 +594,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
{ {
// //
// Detect Signal Trigger ... // Detect Signal Trigger ...
canTrigger = DetectX121SMCXSiganlTrigger( canTrigger = DetectX121SMCXSignalTrigger(
mTmpConditions[i], mTmpConditions[i],
symbol, symbol,
period, period,
@@ -765,8 +677,8 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
} }
// //
// XPZ Signal ... // XOBPV Signal ...
bool DetectXPZSignal( bool DetectXOBPVSignal(
X121SMCStrategyConditions &conditions // X121SMCStrategyConditions &conditions //
) )
{ {
@@ -831,22 +743,22 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
datetime cTime = TimeCurrent(); datetime cTime = TimeCurrent();
// //
ENUM_X_121_SMC_PROVIDERS provider = X_121_SMC_PROVIDER_XPZ; ENUM_X_121_SMC_PROVIDERS provider = X_121_SMC_PROVIDER_XOBPV;
string providerStr = ToString(provider); string providerStr = ToString(provider);
// //
// Detect Setup Conditions ... // Detect Setup Conditions ...
datetime setupTime = mXPZConditions.setupTime; datetime setupTime = mXOBPVConditions.setupTime;
bool isSetuped = mXPZConditions.IsSetuped(); bool isSetuped = mXOBPVConditions.IsSetuped();
ENUM_X_DIRECTION setupDir = mXPZConditions.dir; ENUM_X_DIRECTION setupDir = mXOBPVConditions.dir;
if (!isSetuped) if (!isSetuped)
{ {
// //
// Detect Signal Setup ... // Detect Signal Setup ...
isSetuped = DetectX121SMCXPZSiganlSetup( isSetuped = DetectX121SMCXOBPVSignalSetup(
symbol, symbol,
period, period,
mXPZConditions, mXOBPVConditions,
mTriggerCycleHelper, mTriggerCycleHelper,
mDecisionCycleHelper, mDecisionCycleHelper,
mAnalyseCycleHelper, mAnalyseCycleHelper,
@@ -856,25 +768,25 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
); );
// //
setupDir = mXPZConditions.dir; setupDir = mXOBPVConditions.dir;
setupTime = mXPZConditions.setupTime; setupTime = mXOBPVConditions.setupTime;
// //
if (isSetuped) if (isSetuped)
{ {
// //
int items = AddX121SMCXPZConditionsIfNotExists( int items = AddX121SMCXOBPVConditionsIfNotExists(
mXPZConditions, mXOBPVConditions,
mXPZConditionsCollection // mXOBPVConditionsCollection //
); );
// //
mXPZConditions.Clean(); mXOBPVConditions.Clean();
} }
} }
// //
int conditionsCount = ArraySize(mXPZConditionsCollection); int conditionsCount = ArraySize(mXOBPVConditionsCollection);
result = IsValidSize(conditionsCount); result = IsValidSize(conditionsCount);
if (!result) if (!result)
{ {
@@ -884,12 +796,12 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// Looking For Conditions ... // Looking For Conditions ...
int selectedIndex = 0; int selectedIndex = 0;
X121SMCStrategyXPZSignalConditions mTmpConditions[]; X121SMCStrategyXOBPVSignalConditions mTmpConditions[];
Copy( Copy(
mXPZConditionsCollection, mXOBPVConditionsCollection,
mTmpConditions // mTmpConditions //
); );
X121SMCStrategyXPZSignalConditions mConditions; X121SMCStrategyXOBPVSignalConditions mConditions;
for (int i = 0; i < conditionsCount; i++) for (int i = 0; i < conditionsCount; i++)
{ {
// //
@@ -900,7 +812,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
{ {
// //
// Detect Signal Trigger ... // Detect Signal Trigger ...
canTrigger = DetectX121SMCXPZSiganlTrigger( canTrigger = DetectX121SMCXOBPVSignalTrigger(
mTmpConditions[i], mTmpConditions[i],
symbol, symbol,
period, period,
@@ -922,7 +834,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
{ {
// //
ArrayRemove( ArrayRemove(
mXPZConditionsCollection, mXOBPVConditionsCollection,
i, i,
1 // 1 //
); );
@@ -955,661 +867,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
// //
// Remove Selected Index from Main Collection ... // Remove Selected Index from Main Collection ...
ArrayRemove( ArrayRemove(
mXPZConditionsCollection, mXOBPVConditionsCollection,
selectedIndex,
1 //
);
//
// Check Signal Direction ...
isBullish = IsBullish(mConditions.dir);
isBearish = IsBearish(mConditions.dir);
result = isBullish ||
isBearish;
if (!result)
{
return result;
}
//
// Issues Signal on Conditions ...
conditions.sl = mConditions.sl;
conditions.provider = providerStr;
conditions.signalDir = mConditions.dir;
conditions.target = mConditions.target;
//
return result;
}
//
// XPVT Signal ...
bool DetectXPVTSignal(
X121SMCStrategyConditions &conditions //
)
{
//
bool result = false;
//
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;
}
//
double cLL = cBar.FindLowest(7, MODE_LOW);
double cHH = cBar.FindHighest(7, MODE_HIGH);
//
datetime cTime = TimeCurrent();
//
ENUM_X_121_SMC_PROVIDERS provider = X_121_SMC_PROVIDER_XPVT;
string providerStr = ToString(provider);
//
// Detect Setup Conditions ...
datetime setupTime = mXPVTConditions.setupTime;
bool isSetuped = mXPVTConditions.IsSetuped();
ENUM_X_DIRECTION setupDir = mXPVTConditions.dir;
if (!isSetuped)
{
//
// Detect Signal Setup ...
isSetuped = DetectX121SMCXPVTSiganlSetup(
symbol,
period,
mXPVTConditions,
mTriggerCycleHelper,
mDecisionCycleHelper,
mAnalyseCycleHelper,
mVerificationCycleHelper,
mConsolidationCycleHelper,
mVisionCycleHelper //
);
//
setupDir = mXPVTConditions.dir;
setupTime = mXPVTConditions.setupTime;
//
if (isSetuped)
{
//
int items = AddX121SMCXPVTConditionsIfNotExists(
mXPVTConditions,
mXPVTConditionsCollection //
);
//
mXPVTConditions.Clean();
}
}
//
int conditionsCount = ArraySize(mXPVTConditionsCollection);
result = IsValidSize(conditionsCount);
if (!result)
{
return result;
}
//
// Looking For Conditions ...
int selectedIndex = 0;
X121SMCStrategyXPVTSignalConditions mTmpConditions[];
Copy(
mXPVTConditionsCollection,
mTmpConditions //
);
X121SMCStrategyXPVTSignalConditions mConditions;
for (int i = 0; i < conditionsCount; i++)
{
//
// Check Triggers ...
bool canTrigger = mTmpConditions[i].CanTrigger();
datetime triggerTime = mTmpConditions[i].triggerTime;
if (!canTrigger)
{
//
// Detect Signal Trigger ...
canTrigger = DetectX121SMCXPVTSiganlTrigger(
mTmpConditions[i],
symbol,
period,
mTriggerCycleHelper,
mDecisionCycleHelper,
mAnalyseCycleHelper,
mVerificationCycleHelper,
mConsolidationCycleHelper,
mVisionCycleHelper //
);
//
result = canTrigger;
if (!result)
{
//
bool isISetuped = mTmpConditions[i].IsSetuped();
if (!isISetuped)
{
//
ArrayRemove(
mXPVTConditionsCollection,
i,
1 //
);
}
continue;
}
//
triggerTime = mTmpConditions[i].triggerTime;
}
//
if (canTrigger)
{
//
selectedIndex = i;
mConditions = mTmpConditions[i];
break;
}
}
//
result = IsValid(mConditions.setupTime) &&
HasDirection(mConditions.dir);
if (!result)
{
return result;
}
//
// Remove Selected Index from Main Collection ...
ArrayRemove(
mXPVTConditionsCollection,
selectedIndex,
1 //
);
//
// Check Signal Direction ...
isBullish = IsBullish(mConditions.dir);
isBearish = IsBearish(mConditions.dir);
result = isBullish ||
isBearish;
if (!result)
{
return result;
}
//
// Issues Signal on Conditions ...
conditions.sl = mConditions.sl;
conditions.provider = providerStr;
conditions.signalDir = mConditions.dir;
conditions.target = mConditions.target;
//
return result;
}
//
// XSTRPV Signal ...
bool DetectXSTRPVSignal(
X121SMCStrategyConditions &conditions //
)
{
//
bool result = false;
//
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;
}
//
double cLL = cBar.FindLowest(7, MODE_LOW);
double cHH = cBar.FindHighest(7, MODE_HIGH);
//
datetime cTime = TimeCurrent();
//
ENUM_X_121_SMC_PROVIDERS provider = X_121_SMC_PROVIDER_XSTRPV;
string providerStr = ToString(provider);
//
// Detect Setup Conditions ...
datetime setupTime = mXSTRPVConditions.setupTime;
bool isSetuped = mXSTRPVConditions.IsSetuped();
ENUM_X_DIRECTION setupDir = mXSTRPVConditions.dir;
if (!isSetuped)
{
//
// Detect Signal Setup ...
isSetuped = DetectX121SMCXSTRPVSiganlSetup(
symbol,
period,
mXSTRPVConditions,
mTriggerCycleHelper,
mDecisionCycleHelper,
mAnalyseCycleHelper,
mVerificationCycleHelper,
mConsolidationCycleHelper,
mVisionCycleHelper //
);
//
setupDir = mXSTRPVConditions.dir;
setupTime = mXSTRPVConditions.setupTime;
//
if (isSetuped)
{
//
int items = AddX121SMCXSTRPVConditionsIfNotExists(
mXSTRPVConditions,
mXSTRPVConditionsCollection //
);
//
mXSTRPVConditions.Clean();
}
}
//
int conditionsCount = ArraySize(mXSTRPVConditionsCollection);
result = IsValidSize(conditionsCount);
if (!result)
{
return result;
}
//
// Looking For Conditions ...
int selectedIndex = 0;
X121SMCStrategyXSTRPVSignalConditions mTmpConditions[];
Copy(
mXSTRPVConditionsCollection,
mTmpConditions //
);
X121SMCStrategyXSTRPVSignalConditions mConditions;
for (int i = 0; i < conditionsCount; i++)
{
//
// Check Triggers ...
bool canTrigger = mTmpConditions[i].CanTrigger();
datetime triggerTime = mTmpConditions[i].triggerTime;
if (!canTrigger)
{
//
// Detect Signal Trigger ...
canTrigger = DetectX121SMCXSTRPVSiganlTrigger(
mTmpConditions[i],
symbol,
period,
mTriggerCycleHelper,
mDecisionCycleHelper,
mAnalyseCycleHelper,
mVerificationCycleHelper,
mConsolidationCycleHelper,
mVisionCycleHelper //
);
//
result = canTrigger;
if (!result)
{
//
bool isISetuped = mTmpConditions[i].IsSetuped();
if (!isISetuped)
{
//
ArrayRemove(
mXSTRPVConditionsCollection,
i,
1 //
);
}
continue;
}
//
triggerTime = mTmpConditions[i].triggerTime;
}
//
if (canTrigger)
{
//
selectedIndex = i;
mConditions = mTmpConditions[i];
break;
}
}
//
result = IsValid(mConditions.setupTime) &&
HasDirection(mConditions.dir);
if (!result)
{
return result;
}
//
// Remove Selected Index from Main Collection ...
ArrayRemove(
mXSTRPVConditionsCollection,
selectedIndex,
1 //
);
//
// Check Signal Direction ...
isBullish = IsBullish(mConditions.dir);
isBearish = IsBearish(mConditions.dir);
result = isBullish ||
isBearish;
if (!result)
{
return result;
}
//
// Issues Signal on Conditions ...
conditions.sl = mConditions.sl;
conditions.provider = providerStr;
conditions.signalDir = mConditions.dir;
conditions.target = mConditions.target;
//
return result;
}
//
// XRSPVI Signal ...
bool DetectXRSPVISignal(
X121SMCStrategyConditions &conditions //
)
{
//
bool result = false;
//
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;
}
//
double cLL = cBar.FindLowest(7, MODE_LOW);
double cHH = cBar.FindHighest(7, MODE_HIGH);
//
datetime cTime = TimeCurrent();
//
ENUM_X_121_SMC_PROVIDERS provider = X_121_SMC_PROVIDER_XRSPVI;
string providerStr = ToString(provider);
//
// Detect Setup Conditions ...
datetime setupTime = mXRSPVIConditions.setupTime;
bool isSetuped = mXRSPVIConditions.IsSetuped();
ENUM_X_DIRECTION setupDir = mXRSPVIConditions.dir;
if (!isSetuped)
{
//
// Detect Signal Setup ...
isSetuped = DetectX121SMCXRSPVISiganlSetup(
symbol,
period,
mXRSPVIConditions,
mTriggerCycleHelper,
mDecisionCycleHelper,
mAnalyseCycleHelper,
mVerificationCycleHelper,
mConsolidationCycleHelper,
mVisionCycleHelper //
);
//
setupDir = mXRSPVIConditions.dir;
setupTime = mXRSPVIConditions.setupTime;
//
if (isSetuped)
{
//
int items = AddX121SMCXRSPVIConditionsIfNotExists(
mXRSPVIConditions,
mXRSPVIConditionsCollection //
);
//
mXRSPVIConditions.Clean();
}
}
//
int conditionsCount = ArraySize(mXRSPVIConditionsCollection);
result = IsValidSize(conditionsCount);
if (!result)
{
return result;
}
//
// Looking For Conditions ...
int selectedIndex = 0;
X121SMCStrategyXRSPVISignalConditions mTmpConditions[];
Copy(
mXRSPVIConditionsCollection,
mTmpConditions //
);
X121SMCStrategyXRSPVISignalConditions mConditions;
for (int i = 0; i < conditionsCount; i++)
{
//
// Check Triggers ...
bool canTrigger = mTmpConditions[i].CanTrigger();
datetime triggerTime = mTmpConditions[i].triggerTime;
if (!canTrigger)
{
//
// Detect Signal Trigger ...
canTrigger = DetectX121SMCXRSPVISiganlTrigger(
mTmpConditions[i],
symbol,
period,
mTriggerCycleHelper,
mDecisionCycleHelper,
mAnalyseCycleHelper,
mVerificationCycleHelper,
mConsolidationCycleHelper,
mVisionCycleHelper //
);
//
result = canTrigger;
if (!result)
{
//
bool isISetuped = mTmpConditions[i].IsSetuped();
if (!isISetuped)
{
//
ArrayRemove(
mXRSPVIConditionsCollection,
i,
1 //
);
}
continue;
}
//
triggerTime = mTmpConditions[i].triggerTime;
}
//
if (canTrigger)
{
//
selectedIndex = i;
mConditions = mTmpConditions[i];
break;
}
}
//
result = IsValid(mConditions.setupTime) &&
HasDirection(mConditions.dir);
if (!result)
{
return result;
}
//
// Remove Selected Index from Main Collection ...
ArrayRemove(
mXRSPVIConditionsCollection,
selectedIndex, selectedIndex,
1 // 1 //
); );
@@ -1651,11 +909,8 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
void InitialHelpers() void InitialHelpers()
{ {
// //
useXSignal = true; useXSignal = false;
useXPZSignal = false; useXOBPVSignal = true;
useXPVTSignal = false;
useXRSPVISignal = false;
useXSTRPVSignal = false;
// //
string symbol = GetSymbol(); string symbol = GetSymbol();