Try to Complete Senario 2 (Using Breaked Boxes on Overal Trend) ...
This commit is contained in:
@@ -1672,7 +1672,32 @@ if (useSenario1)
|
|||||||
isBearish = false;
|
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,
|
XBoxZone &box,
|
||||||
ENUM_X_DIRECTION &dir,
|
ENUM_X_DIRECTION &dir,
|
||||||
X121SMCStrategySignalProviderData &provider,
|
X121SMCStrategySignalProviderData &provider,
|
||||||
int barIndex = 0 //
|
int barIndex = 0,
|
||||||
|
bool forceBarType = false,
|
||||||
|
bool forceFiboPressure = false, //
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -2977,6 +2979,9 @@ struct X121SMCStrategyConditionParser
|
|||||||
barIndex = 0;
|
barIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Define Resources ...
|
||||||
|
|
||||||
//
|
//
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
@@ -3061,6 +3066,7 @@ struct X121SMCStrategyConditionParser
|
|||||||
: false;
|
: false;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Check Inside ...
|
||||||
if (isInside)
|
if (isInside)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -3077,6 +3083,7 @@ struct X121SMCStrategyConditionParser
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Check Inside Box is Valid or not ...
|
||||||
result = insideBox.IsValid();
|
result = insideBox.IsValid();
|
||||||
if (!result)
|
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 = cTime;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect Breaked Box Direction ...
|
||||||
|
bool isInsideBoxBullish = insideBox.IsBullish();
|
||||||
|
bool isInsideBoxBearish = insideBox.IsBearish();
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
insideBox.from = insideBox.to;
|
isUpperBearishReject =
|
||||||
insideBox.to = zBar.time;
|
isUpperBearishReject &&
|
||||||
|
cBar.IsBearish();
|
||||||
|
|
||||||
//
|
//
|
||||||
XCBoxObject *iObj;
|
isUpperBullishReject =
|
||||||
has = ttfHelper.mPOIDrawer.DrawBox(
|
isUpperBullishReject &&
|
||||||
insideBox,
|
cBar.IsBullish();
|
||||||
iObj //
|
|
||||||
);
|
|
||||||
if (has) {
|
|
||||||
//
|
|
||||||
iObj.Width(2);
|
|
||||||
iObj.BoxColor(clrGray);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
Print("Has Inside Box ...");
|
isLowerBearishReject =
|
||||||
|
isLowerBearishReject &&
|
||||||
|
cBar.IsBearish();
|
||||||
|
|
||||||
|
//
|
||||||
|
isLowerBullishReject =
|
||||||
|
isLowerBullishReject &&
|
||||||
|
cBar.IsBullish();
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// 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 ...
|
// Bullish Conditions ...
|
||||||
isBullish = (
|
isBullish = (
|
||||||
//
|
//
|
||||||
false
|
hasBullishTrend &&
|
||||||
|
isInsideBoxBearish &&
|
||||||
|
isLowerBullishReject
|
||||||
//
|
//
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -3126,7 +3220,9 @@ struct X121SMCStrategyConditionParser
|
|||||||
// Bearish Conditions ...
|
// Bearish Conditions ...
|
||||||
isBearish = (
|
isBearish = (
|
||||||
//
|
//
|
||||||
false
|
hasBearishTrend &&
|
||||||
|
isInsideBoxBullish &&
|
||||||
|
isUpperBearishReject
|
||||||
//
|
//
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -3137,6 +3233,14 @@ struct X121SMCStrategyConditionParser
|
|||||||
isBearish;
|
isBearish;
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
|
//
|
||||||
|
box = insideBox;
|
||||||
|
|
||||||
|
//
|
||||||
|
dir =
|
||||||
|
isBullish
|
||||||
|
? X_DIRECTION_BULLISH
|
||||||
|
: X_DIRECTION_BEARISH;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -3158,6 +3262,7 @@ struct X121SMCStrategyConditionParser
|
|||||||
|
|
||||||
//
|
//
|
||||||
ttfState.Clean();
|
ttfState.Clean();
|
||||||
|
insideBox.Clean();
|
||||||
ZeroMemory(ttfHelper);
|
ZeroMemory(ttfHelper);
|
||||||
ttfConditions.Clean();
|
ttfConditions.Clean();
|
||||||
ttfXConditions.Clean();
|
ttfXConditions.Clean();
|
||||||
|
|||||||
@@ -302,6 +302,32 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
if (hasSignalBox)
|
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)
|
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);
|
isBullish = IsBullish(signalBoxDir);
|
||||||
isBearish = IsBearish(signalBoxDir);
|
isBearish = IsBearish(signalBoxDir);
|
||||||
|
|
||||||
@@ -502,7 +520,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
|||||||
|
|
||||||
//
|
//
|
||||||
double iAtr = provider.decisionXConditions.atrBuffer[1];
|
double iAtr = provider.decisionXConditions.atrBuffer[1];
|
||||||
iAtr *= 2;
|
iAtr *= 1.5;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Select Condition SL ...
|
// Select Condition SL ...
|
||||||
|
|||||||
@@ -804,10 +804,10 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
|
|
||||||
//
|
//
|
||||||
// XPV ...
|
// XPV ...
|
||||||
x121Inputs.xpvInputs.showSar = showAll || true;
|
x121Inputs.xpvInputs.showSar = showAll || false;
|
||||||
x121Inputs.xpvInputs.showPeaks = showAll || true;
|
x121Inputs.xpvInputs.showPeaks = showAll || false;
|
||||||
x121Inputs.xpvInputs.showVales = showAll || true;
|
x121Inputs.xpvInputs.showVales = showAll || false;
|
||||||
x121Inputs.xpvInputs.showGoldenZones = showAll || true;
|
x121Inputs.xpvInputs.showGoldenZones = showAll || false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// XHK ...
|
// XHK ...
|
||||||
@@ -823,7 +823,7 @@ class XCX121SMCStrategy : public XCX121SMCBaseStrategy
|
|||||||
|
|
||||||
//
|
//
|
||||||
// XSTR ...
|
// XSTR ...
|
||||||
x121Inputs.xstrInputs.showStr = showAll || true;
|
x121Inputs.xstrInputs.showStr = showAll || false;
|
||||||
x121Inputs.xstrInputs.showStrUpper = showAll || false;
|
x121Inputs.xstrInputs.showStrUpper = showAll || false;
|
||||||
x121Inputs.xstrInputs.showStrLower = showAll || false;
|
x121Inputs.xstrInputs.showStrLower = showAll || false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user