last ...
This commit is contained in:
@@ -40,6 +40,7 @@ class XCXCAEASignaller : XCBase
|
||||
//
|
||||
// Props ...
|
||||
bool useGuards;
|
||||
bool useTargets;
|
||||
int poiLoopback;
|
||||
XCAEAInputs inputs;
|
||||
XBarTracker barTraker;
|
||||
@@ -407,19 +408,44 @@ class XCXCAEASignaller : XCBase
|
||||
|
||||
//
|
||||
// Targets Preparing ...
|
||||
Copy(
|
||||
targets,
|
||||
mConditions.targets //
|
||||
);
|
||||
|
||||
//
|
||||
// Select RF Rewards ...
|
||||
if (continuesRFTillTarget)
|
||||
if (useTargets)
|
||||
{
|
||||
//
|
||||
double rfReward = 1;
|
||||
while (rfReward < tpReward)
|
||||
Copy(
|
||||
targets,
|
||||
mConditions.targets //
|
||||
);
|
||||
|
||||
//
|
||||
// Select RF Rewards ...
|
||||
if (continuesRFTillTarget)
|
||||
{
|
||||
//
|
||||
double rfReward = 1;
|
||||
while (rfReward < tpReward)
|
||||
{
|
||||
//
|
||||
double rewardRF = risk * rfReward;
|
||||
double rfTP =
|
||||
isBullish
|
||||
? entry + rewardRF
|
||||
: entry - rewardRF;
|
||||
|
||||
//
|
||||
Add(
|
||||
rfTP,
|
||||
mConditions.targets //
|
||||
);
|
||||
|
||||
//
|
||||
rfReward++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
double rfReward = 2;
|
||||
|
||||
//
|
||||
double rewardRF = risk * rfReward;
|
||||
double rfTP =
|
||||
@@ -432,116 +458,95 @@ class XCXCAEASignaller : XCBase
|
||||
rfTP,
|
||||
mConditions.targets //
|
||||
);
|
||||
|
||||
//
|
||||
rfReward++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
double rfReward = 2;
|
||||
|
||||
//
|
||||
double rewardRF = risk * rfReward;
|
||||
double rfTP =
|
||||
isBullish
|
||||
? entry + rewardRF
|
||||
: entry - rewardRF;
|
||||
|
||||
//
|
||||
Add(
|
||||
rfTP,
|
||||
mConditions.targets //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Detect Rf on Invalid Pivots ...
|
||||
if (rfOnInvalidPivots)
|
||||
{
|
||||
//
|
||||
has = detector.HasInvalidPivots();
|
||||
if (has)
|
||||
// Detect Rf on Invalid Pivots ...
|
||||
if (rfOnInvalidPivots)
|
||||
{
|
||||
//
|
||||
XBoxZone targetBox;
|
||||
double targetBoxPrice = 0;
|
||||
count = detector.CountInvalidPivots();
|
||||
for (int i = 0; i < count; i++)
|
||||
has = detector.HasInvalidPivots();
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
XBoxZone iPivot = detector.invalidPivots[i];
|
||||
|
||||
//
|
||||
bool isValidPivot =
|
||||
Contains(
|
||||
"XCA_PEAKSWHRES",
|
||||
iPivot.type //
|
||||
) ||
|
||||
Contains(
|
||||
"XCA_VALESWLSUP",
|
||||
iPivot.type //
|
||||
) ||
|
||||
Contains(
|
||||
"XCA_FVG",
|
||||
iPivot.type //
|
||||
);
|
||||
if (!isValidPivot)
|
||||
XBoxZone targetBox;
|
||||
double targetBoxPrice = 0;
|
||||
count = detector.CountInvalidPivots();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
XBoxZone iPivot = detector.invalidPivots[i];
|
||||
|
||||
//
|
||||
bool isValidPivot =
|
||||
Contains(
|
||||
"XCA_PEAKSWHRES",
|
||||
iPivot.type //
|
||||
) ||
|
||||
Contains(
|
||||
"XCA_VALESWLSUP",
|
||||
iPivot.type //
|
||||
) ||
|
||||
Contains(
|
||||
"XCA_FVG",
|
||||
iPivot.type //
|
||||
);
|
||||
if (!isValidPivot)
|
||||
{
|
||||
//
|
||||
iPivot.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
double selectedPrice =
|
||||
isBullish
|
||||
? iPivot.lower - (5 * points)
|
||||
: iPivot.upper + (5 * points);
|
||||
|
||||
//
|
||||
double targetBoxSelectedPrice =
|
||||
isBullish
|
||||
? targetBox.lower - (5 * points)
|
||||
: targetBox.upper + (5 * points);
|
||||
|
||||
//
|
||||
bool isDirPassed = iPivot.dir = signalBoxDir;
|
||||
bool isPricePassed =
|
||||
isBullish
|
||||
? entry < selectedPrice
|
||||
: entry > selectedPrice;
|
||||
bool canSetTarget =
|
||||
!targetBox.IsValid()
|
||||
? true
|
||||
: isBullish
|
||||
? targetBoxSelectedPrice > selectedPrice
|
||||
: targetBoxSelectedPrice < selectedPrice;
|
||||
if (canSetTarget)
|
||||
{
|
||||
//
|
||||
targetBox = iPivot;
|
||||
targetBoxPrice = targetBoxSelectedPrice;
|
||||
}
|
||||
|
||||
//
|
||||
iPivot.Clean();
|
||||
continue;
|
||||
}
|
||||
|
||||
//
|
||||
double selectedPrice =
|
||||
isBullish
|
||||
? iPivot.lower - (5 * points)
|
||||
: iPivot.upper + (5 * points);
|
||||
|
||||
//
|
||||
double targetBoxSelectedPrice =
|
||||
isBullish
|
||||
? targetBox.lower - (5 * points)
|
||||
: targetBox.upper + (5 * points);
|
||||
|
||||
//
|
||||
bool isDirPassed = iPivot.dir = signalBoxDir;
|
||||
bool isPricePassed =
|
||||
isBullish
|
||||
? entry < selectedPrice
|
||||
: entry > selectedPrice;
|
||||
bool canSetTarget =
|
||||
!targetBox.IsValid()
|
||||
? true
|
||||
: isBullish
|
||||
? targetBoxSelectedPrice > selectedPrice
|
||||
: targetBoxSelectedPrice < selectedPrice;
|
||||
if (canSetTarget)
|
||||
if (targetBox.IsValid() &&
|
||||
targetBoxPrice > 0)
|
||||
{
|
||||
//
|
||||
targetBox = iPivot;
|
||||
targetBoxPrice = targetBoxSelectedPrice;
|
||||
Add(
|
||||
targetBoxPrice,
|
||||
mConditions.targets //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
iPivot.Clean();
|
||||
targetBox.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
if (targetBox.IsValid() &&
|
||||
targetBoxPrice > 0)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
targetBoxPrice,
|
||||
mConditions.targets //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
targetBox.Clean();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -766,6 +771,7 @@ class XCXCAEASignaller : XCBase
|
||||
{
|
||||
//
|
||||
useGuards = false;
|
||||
useTargets = false;
|
||||
rfOnInvalidPivots = false;
|
||||
continuesRFTillTarget = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user