Add Support for Sar Changes Detection ...
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user