Try to Complete Senario 2 (Using Breaked Boxes on Overal Trend) ...
This commit is contained in:
@@ -1672,7 +1672,32 @@ if (useSenario1)
|
||||
isBearish = false;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
// Here we Looking for Detectiong Signal Conditions ...
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
insideBox.from = insideBox.to;
|
||||
insideBox.to = zBar.time;
|
||||
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
has = ttfHelper.mPOIDrawer.DrawBox(
|
||||
insideBox,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
iObj.Width(2);
|
||||
iObj.BoxColor(clrGray);
|
||||
}
|
||||
|
||||
//
|
||||
Print("Has Inside Box ...");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -2917,7 +2917,9 @@ struct X121SMCStrategyConditionParser
|
||||
XBoxZone &box,
|
||||
ENUM_X_DIRECTION &dir,
|
||||
X121SMCStrategySignalProviderData &provider,
|
||||
int barIndex = 0 //
|
||||
int barIndex = 0,
|
||||
bool forceBarType = false,
|
||||
bool forceFiboPressure = false, //
|
||||
)
|
||||
{
|
||||
//
|
||||
@@ -2977,6 +2979,9 @@ struct X121SMCStrategyConditionParser
|
||||
barIndex = 0;
|
||||
}
|
||||
|
||||
//
|
||||
// Define Resources ...
|
||||
|
||||
//
|
||||
int idx = -1;
|
||||
int count = 0;
|
||||
@@ -3061,6 +3066,7 @@ struct X121SMCStrategyConditionParser
|
||||
: false;
|
||||
|
||||
//
|
||||
// Check Inside ...
|
||||
if (isInside)
|
||||
{
|
||||
//
|
||||
@@ -3077,6 +3083,7 @@ struct X121SMCStrategyConditionParser
|
||||
}
|
||||
|
||||
//
|
||||
// Check Inside Box is Valid or not ...
|
||||
result = insideBox.IsValid();
|
||||
if (!result)
|
||||
{
|
||||
@@ -3092,33 +3099,120 @@ struct X121SMCStrategyConditionParser
|
||||
}
|
||||
|
||||
//
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
// Update Inside Box From and To ...
|
||||
// Based on Breaked ...
|
||||
insideBox.from = insideBox.to;
|
||||
insideBox.to = zBar.time;
|
||||
insideBox.to = cTime;
|
||||
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
has = ttfHelper.mPOIDrawer.DrawBox(
|
||||
insideBox,
|
||||
iObj //
|
||||
);
|
||||
if (has) {
|
||||
// Detect Breaked Box Direction ...
|
||||
bool isInsideBoxBullish = insideBox.IsBullish();
|
||||
bool isInsideBoxBearish = insideBox.IsBearish();
|
||||
|
||||
//
|
||||
iObj.Width(2);
|
||||
iObj.BoxColor(clrGray);
|
||||
// Detect Inside Box Rejection ...
|
||||
|
||||
//
|
||||
bool isUpperBearishReject =
|
||||
cBar.high >= insideBox.upper &&
|
||||
cBar.GetUp() < insideBox.upper;
|
||||
|
||||
//
|
||||
bool isUpperBullishReject =
|
||||
cBar.low <= insideBox.upper &&
|
||||
cBar.GetDown() > insideBox.upper;
|
||||
|
||||
//
|
||||
bool isLowerBearishReject =
|
||||
cBar.high >= insideBox.lower &&
|
||||
cBar.GetUp() < insideBox.lower;
|
||||
|
||||
//
|
||||
bool isLowerBullishReject =
|
||||
cBar.low <= insideBox.lower &&
|
||||
cBar.GetDown() > insideBox.lower;
|
||||
|
||||
//
|
||||
// Apply Force Bar Type ...
|
||||
if (forceBarType)
|
||||
{
|
||||
//
|
||||
isUpperBearishReject =
|
||||
isUpperBearishReject &&
|
||||
cBar.IsBearish();
|
||||
|
||||
//
|
||||
isUpperBullishReject =
|
||||
isUpperBullishReject &&
|
||||
cBar.IsBullish();
|
||||
|
||||
//
|
||||
isLowerBearishReject =
|
||||
isLowerBearishReject &&
|
||||
cBar.IsBearish();
|
||||
|
||||
//
|
||||
isLowerBullishReject =
|
||||
isLowerBullishReject &&
|
||||
cBar.IsBullish();
|
||||
}
|
||||
|
||||
//
|
||||
Print("Has Inside Box ...");
|
||||
// Apply Force Fibo Pressure ...
|
||||
if (forceBarType)
|
||||
{
|
||||
//
|
||||
isUpperBearishReject =
|
||||
isUpperBearishReject &&
|
||||
ttfHelper
|
||||
.mBarAnalyser
|
||||
.HasFiboPressure(
|
||||
cBar,
|
||||
X_DIRECTION_BEARISH,
|
||||
X_FIBO_LEVEL_382 //
|
||||
);
|
||||
|
||||
//
|
||||
isUpperBullishReject =
|
||||
isUpperBullishReject &&
|
||||
ttfHelper
|
||||
.mBarAnalyser
|
||||
.HasFiboPressure(
|
||||
cBar,
|
||||
X_DIRECTION_BULLISH,
|
||||
X_FIBO_LEVEL_382 //
|
||||
);
|
||||
|
||||
//
|
||||
isLowerBearishReject =
|
||||
isLowerBearishReject &&
|
||||
ttfHelper
|
||||
.mBarAnalyser
|
||||
.HasFiboPressure(
|
||||
cBar,
|
||||
X_DIRECTION_BEARISH,
|
||||
X_FIBO_LEVEL_382 //
|
||||
);
|
||||
|
||||
//
|
||||
isLowerBullishReject =
|
||||
isLowerBullishReject &&
|
||||
ttfHelper
|
||||
.mBarAnalyser
|
||||
.HasFiboPressure(
|
||||
cBar,
|
||||
X_DIRECTION_BULLISH,
|
||||
X_FIBO_LEVEL_382 //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Bullish Conditions ...
|
||||
isBullish = (
|
||||
//
|
||||
false
|
||||
hasBullishTrend &&
|
||||
isInsideBoxBearish &&
|
||||
isLowerBullishReject
|
||||
//
|
||||
);
|
||||
|
||||
@@ -3126,7 +3220,9 @@ struct X121SMCStrategyConditionParser
|
||||
// Bearish Conditions ...
|
||||
isBearish = (
|
||||
//
|
||||
false
|
||||
hasBearishTrend &&
|
||||
isInsideBoxBullish &&
|
||||
isUpperBearishReject
|
||||
//
|
||||
);
|
||||
|
||||
@@ -3137,6 +3233,14 @@ struct X121SMCStrategyConditionParser
|
||||
isBearish;
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
box = insideBox;
|
||||
|
||||
//
|
||||
dir =
|
||||
isBullish
|
||||
? X_DIRECTION_BULLISH
|
||||
: X_DIRECTION_BEARISH;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -3158,6 +3262,7 @@ struct X121SMCStrategyConditionParser
|
||||
|
||||
//
|
||||
ttfState.Clean();
|
||||
insideBox.Clean();
|
||||
ZeroMemory(ttfHelper);
|
||||
ttfConditions.Clean();
|
||||
ttfXConditions.Clean();
|
||||
|
||||
@@ -302,6 +302,32 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
if (hasSignalBox)
|
||||
{
|
||||
//
|
||||
// Remove Signal Box from UnAvailable Box ...
|
||||
// if Exists ...
|
||||
bool hasUnAvailableBoxes = workingZone
|
||||
.HasUnavailableBoxes();
|
||||
if (hasUnAvailableBoxes)
|
||||
{
|
||||
//
|
||||
int idx = FindIndex(
|
||||
signalBox,
|
||||
workingZone.unavailableBoxes //
|
||||
);
|
||||
bool has = IsValidIndex(idx);
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
ArrayRemove(
|
||||
workingZone.unavailableBoxes,
|
||||
idx,
|
||||
1 //
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Add Signal Box to UnAvailable Boxes ...
|
||||
// if Exists in Waiting Boxes ...
|
||||
if (hasWaitingBoxes)
|
||||
{
|
||||
//
|
||||
@@ -320,15 +346,6 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
AddRef(
|
||||
signalBox,
|
||||
workingZone.unavailableBoxes //
|
||||
);
|
||||
|
||||
//
|
||||
signalBox.to = cTime;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -420,6 +437,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Signal Direction ...
|
||||
isBullish = IsBullish(signalBoxDir);
|
||||
isBearish = IsBearish(signalBoxDir);
|
||||
|
||||
@@ -502,7 +520,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
|
||||
//
|
||||
double iAtr = provider.decisionXConditions.atrBuffer[1];
|
||||
iAtr *= 2;
|
||||
iAtr *= 1.5;
|
||||
|
||||
//
|
||||
// Select Condition SL ...
|
||||
|
||||
@@ -804,10 +804,10 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// XPV ...
|
||||
x121Inputs.xpvInputs.showSar = showAll || true;
|
||||
x121Inputs.xpvInputs.showPeaks = showAll || true;
|
||||
x121Inputs.xpvInputs.showVales = showAll || true;
|
||||
x121Inputs.xpvInputs.showGoldenZones = showAll || true;
|
||||
x121Inputs.xpvInputs.showSar = showAll || false;
|
||||
x121Inputs.xpvInputs.showPeaks = showAll || false;
|
||||
x121Inputs.xpvInputs.showVales = showAll || false;
|
||||
x121Inputs.xpvInputs.showGoldenZones = showAll || false;
|
||||
|
||||
//
|
||||
// XHK ...
|
||||
@@ -823,7 +823,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
||||
|
||||
//
|
||||
// XSTR ...
|
||||
x121Inputs.xstrInputs.showStr = showAll || true;
|
||||
x121Inputs.xstrInputs.showStr = showAll || false;
|
||||
x121Inputs.xstrInputs.showStrUpper = showAll || false;
|
||||
x121Inputs.xstrInputs.showStrLower = showAll || false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user