Add Support for Sar Changes Detection ...

This commit is contained in:
2024-12-10 01:38:29 +03:30
parent 812e468151
commit b5cec1f52a
4 changed files with 453 additions and 119 deletions
@@ -124,24 +124,32 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
double pip2 = 2 * pip;
//
// Check Spread ...
// Retrieve and Fill Cycle Conditions ...
result = GetCyclesConditions(conditions);
if (!result)
{
//
conditions.Clean();
return result;
}
//
// Check Spread for Signalling Conditions ...
bool isSpreadPassed = IsSpreadPass();
result = isSpreadPassed;
if (!result)
{
//
// string message = "Spread is not Passed for Analysing ...";
// LogAlert(message);
//
conditions.Clean();
return result;
}
//
// Detect Conditions ...
// Detect Signal Conditions ...
result = DetectConditions(conditions);
if (!result)
{
//
conditions.Clean();
return result;
}
@@ -272,11 +280,13 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
// Actions ...
/**
* Detect and Parse Market Conditions ...
* Retrieve Cycles Conditions ...
*
* @param conditions: X121SMCStrategyConditions instance Reference ...
*
* @return ( bool )
*/
bool DetectConditions(
bool GetCyclesConditions(
X121SMCStrategyConditions &conditions //
)
{
@@ -294,34 +304,6 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
int ppIndex = pIndex + 1;
//
XOHCL zBar;
result = zBar.Init(
symbol,
period,
zIndex //
);
if (!result)
{
return result;
}
//
XOHCL cBar;
result = cBar.Init(
symbol,
period,
cIndex //
);
if (!result)
{
return result;
}
//
string msg = NULL;
//
double bid = GetBid(symbol);
datetime cTime = TimeCurrent();
//
@@ -425,6 +407,65 @@ class XCX121SMCTestStrategy : public XCX121SMCBaseStrategy
}
conditions.visionConditions.state = mVisionState;
//
return result;
}
/**
* Detect and Parse Market Conditions ...
*
* @param conditions: X121SMCStrategyConditions instance Reference ...
*
* @return ( bool )
*/
bool DetectConditions(
X121SMCStrategyConditions &conditions //
)
{
//
bool result = false;
//
string symbol = GetSymbol();
ENUM_TIMEFRAMES period = GetPeriod();
//
int zIndex = 0;
int cIndex = zIndex + 1;
int pIndex = cIndex + 1;
int ppIndex = pIndex + 1;
//
XOHCL zBar;
result = zBar.Init(
symbol,
period,
zIndex //
);
if (!result)
{
return result;
}
//
XOHCL cBar;
result = cBar.Init(
symbol,
period,
cIndex //
);
if (!result)
{
return result;
}
//
string msg = NULL;
//
double bid = GetBid(symbol);
datetime cTime = TimeCurrent();
// //
// // Detect Valid Supply and Demand Zones ...
// XCSupplyZone *supplyZone;