Apply Last Fixes on TWPV Strategy Method 1 ...
This commit is contained in:
@@ -646,12 +646,6 @@ bool DetectX121SMCXTWPVSiganlSetup(
|
||||
//
|
||||
// Setup Conditions ...
|
||||
|
||||
// //
|
||||
// // Select Sources ...
|
||||
// XC121SMCCycleHelper *helper = analyseCycleHelper;
|
||||
// X121SMCCycleConditions helperConditions = analyseConditions;
|
||||
// XPOIState helperState = analyseState;
|
||||
|
||||
//
|
||||
XOHCL analyseCBar;
|
||||
result = analyseCycleHelper.GetBar(
|
||||
@@ -895,6 +889,62 @@ bool DetectX121SMCXTWPVSiganlSetup(
|
||||
priceInsideZonesCount = conditions.CountPriceInsideZones();
|
||||
}
|
||||
|
||||
//
|
||||
// Check Price Inside Consolidation Zone ...
|
||||
XConsolidationZone cZone;
|
||||
bool hasConsolidationZone = conditions
|
||||
.HasConsolidationZone();
|
||||
if (!hasConsolidationZone)
|
||||
{
|
||||
//
|
||||
hasConsolidationZone = triggerCycleHelper
|
||||
.GetLastConsolidationZone(cZone);
|
||||
//
|
||||
if (!hasConsolidationZone)
|
||||
{
|
||||
//
|
||||
XConsolidationZone cZones[];
|
||||
int count = triggerCycleHelper
|
||||
.FillConsolidationZones(cZones);
|
||||
if (IsValidSize(count))
|
||||
{
|
||||
//
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XConsolidationZone iZone = cZones[i];
|
||||
|
||||
//
|
||||
XCZone *iCZone;
|
||||
bool isInited = ToZone(iZone, iCZone);
|
||||
if (!isInited)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
bool isValid = IsPriceInsideZone(
|
||||
cBar,
|
||||
iCZone //
|
||||
);
|
||||
if (isValid)
|
||||
{
|
||||
cZone = iZone;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
conditions.consolidationZone = cZone;
|
||||
hasConsolidationZone = conditions
|
||||
.HasConsolidationZone();
|
||||
}
|
||||
}
|
||||
if (hasConsolidationZone)
|
||||
{
|
||||
conditions.consolidationZone = cZone;
|
||||
}
|
||||
|
||||
//
|
||||
// PV Conditions ...
|
||||
|
||||
@@ -1221,18 +1271,6 @@ bool DetectX121SMCXTWPVSiganlSetup(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
if (isBullish)
|
||||
{
|
||||
Print("Bullish ...");
|
||||
}
|
||||
|
||||
//
|
||||
if (isBearish)
|
||||
{
|
||||
Print("Bearish ...");
|
||||
}
|
||||
|
||||
//
|
||||
conditions.setupTime = cTime;
|
||||
conditions.dir =
|
||||
@@ -1461,16 +1499,6 @@ bool DetectX121SMCXTWPVSiganlTrigger(
|
||||
//
|
||||
// Trigger Conditions ...
|
||||
|
||||
// //
|
||||
// isBullish =
|
||||
// isBullish &&
|
||||
// false;
|
||||
|
||||
// //
|
||||
// isBearish =
|
||||
// isBearish &&
|
||||
// false;
|
||||
|
||||
//
|
||||
result = isBullish ||
|
||||
isBearish;
|
||||
@@ -1490,34 +1518,34 @@ bool DetectX121SMCXTWPVSiganlTrigger(
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Consolidation ...
|
||||
bool hasConsolidationZone = conditions.HasConsolidationZone();
|
||||
if (hasConsolidationZone)
|
||||
{
|
||||
//
|
||||
hasConsolidationZone = triggerCycleHelper
|
||||
.GetLastConsolidationZone(conditions.consolidationZone);
|
||||
// //
|
||||
// // Detect Consolidation ...
|
||||
// bool hasConsolidationZone = conditions.HasConsolidationZone();
|
||||
// if (hasConsolidationZone)
|
||||
// {
|
||||
// //
|
||||
// hasConsolidationZone = triggerCycleHelper
|
||||
// .GetLastConsolidationZone(conditions.consolidationZone);
|
||||
|
||||
//
|
||||
if (hasConsolidationZone)
|
||||
{
|
||||
//
|
||||
hasConsolidationZone =
|
||||
isBullish
|
||||
? conditions.consolidationZone.upper <= conditions.point
|
||||
: conditions.consolidationZone.lower >= conditions.point;
|
||||
// //
|
||||
// if (hasConsolidationZone)
|
||||
// {
|
||||
// //
|
||||
// hasConsolidationZone =
|
||||
// isBullish
|
||||
// ? conditions.consolidationZone.upper <= conditions.point
|
||||
// : conditions.consolidationZone.lower >= conditions.point;
|
||||
|
||||
//
|
||||
if (!hasConsolidationZone)
|
||||
{
|
||||
//
|
||||
conditions
|
||||
.consolidationZone
|
||||
.Clean();
|
||||
}
|
||||
}
|
||||
}
|
||||
// //
|
||||
// if (!hasConsolidationZone)
|
||||
// {
|
||||
// //
|
||||
// conditions
|
||||
// .consolidationZone
|
||||
// .Clean();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
// Detect Nearest Pivot Point ...
|
||||
@@ -1589,7 +1617,13 @@ bool DetectX121SMCXTWPVSiganlTrigger(
|
||||
|
||||
//
|
||||
// Filling SL Candidates ...
|
||||
double atr = triggerConditions.x121Conditions.atrBuffer[1];
|
||||
|
||||
//
|
||||
double sls[];
|
||||
|
||||
//
|
||||
bool hasConsolidationZone = conditions.HasConsolidationZone();
|
||||
if (hasConsolidationZone)
|
||||
{
|
||||
//
|
||||
@@ -1773,30 +1807,28 @@ bool DetectX121SMCXTWPVSiganlTrigger(
|
||||
|
||||
//
|
||||
double sl = isBullish
|
||||
? slsMin
|
||||
: slsMax;
|
||||
? slsMin - atr
|
||||
: slsMax + atr;
|
||||
double risk = MathAbs(entry - sl);
|
||||
double targetDelta = 2 * (risk / 3);
|
||||
if (target == 0)
|
||||
{
|
||||
//
|
||||
int minTargetPint = 50;
|
||||
double minTargetPointValue = minTargetPint * points;
|
||||
if (targetDelta < minTargetPointValue)
|
||||
{
|
||||
targetDelta = minTargetPointValue;
|
||||
}
|
||||
|
||||
//
|
||||
// Force Target On Half Risk ...
|
||||
target =
|
||||
isBullish
|
||||
? entry + targetDelta
|
||||
: entry - targetDelta;
|
||||
}
|
||||
|
||||
//
|
||||
if (isBullish)
|
||||
{
|
||||
Print("Bullish ...");
|
||||
}
|
||||
|
||||
//
|
||||
if (isBearish)
|
||||
{
|
||||
Print("Bearish ...");
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user