last ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -411,6 +411,7 @@ class XCXCAEASignaller : XCBase
|
|||||||
// Checking Trigger Conditions ...
|
// Checking Trigger Conditions ...
|
||||||
double sl = 0;
|
double sl = 0;
|
||||||
double tp = 0;
|
double tp = 0;
|
||||||
|
XTarget targets[];
|
||||||
ENUM_X_DIRECTION triggerDir = X_DIRECTION_NONE;
|
ENUM_X_DIRECTION triggerDir = X_DIRECTION_NONE;
|
||||||
int toIDX = conditions.decisionZone.ToIndex();
|
int toIDX = conditions.decisionZone.ToIndex();
|
||||||
int fromIDX = conditions.decisionZone.FromIndex();
|
int fromIDX = conditions.decisionZone.FromIndex();
|
||||||
@@ -423,7 +424,17 @@ class XCXCAEASignaller : XCBase
|
|||||||
double decisionMiddlePrice = conditions.decisionZone.GetMid();
|
double decisionMiddlePrice = conditions.decisionZone.GetMid();
|
||||||
|
|
||||||
//
|
//
|
||||||
XBoxZone decisionOBs[];
|
// Draw Decision Zone ...
|
||||||
|
drawer.DrawBox(
|
||||||
|
conditions.decisionZone,
|
||||||
|
cTime,
|
||||||
|
true, // Draw Middle Line ...
|
||||||
|
true // Ignore Type ...
|
||||||
|
);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Detect Required Pivots ...
|
||||||
|
XBoxZone decisionPivots[];
|
||||||
ENUM_XCA_PIVOTS allowedTypes[];
|
ENUM_XCA_PIVOTS allowedTypes[];
|
||||||
if (isBullish)
|
if (isBullish)
|
||||||
{
|
{
|
||||||
@@ -441,29 +452,26 @@ class XCXCAEASignaller : XCBase
|
|||||||
allowedTypes //
|
allowedTypes //
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
int decisionOBsCount = detector.FillPivots(
|
int decisionPivotsCount = detector.FillPivots(
|
||||||
conditions.decisionZone,
|
conditions.decisionZone,
|
||||||
decisionOBs,
|
decisionPivots,
|
||||||
unAvailableBoxes,
|
unAvailableBoxes,
|
||||||
allowedTypes,
|
allowedTypes,
|
||||||
cTime //
|
cTime //
|
||||||
);
|
);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Define a Temparory Objects
|
||||||
|
// Array instance for Holding Drawn Objects ...
|
||||||
CArrayObj *iObjects;
|
CArrayObj *iObjects;
|
||||||
iObjects = new CArrayObj();
|
iObjects = new CArrayObj();
|
||||||
|
|
||||||
|
//
|
||||||
|
// Check Different Trigger Conditions ...
|
||||||
|
|
||||||
//
|
//
|
||||||
// Checking Trigger Cond 0 ...
|
// Checking Trigger Cond 0 ...
|
||||||
bool canTriggerCond0 = false;
|
bool canTriggerCond0 = false;
|
||||||
// CanTriggerCond0(
|
|
||||||
// helper,
|
|
||||||
// conditions.decisionZone,
|
|
||||||
// triggerDir,
|
|
||||||
// sl,
|
|
||||||
// tp,
|
|
||||||
// barIndex //
|
|
||||||
// );
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Checking Trigger Cond 1 ...
|
// Checking Trigger Cond 1 ...
|
||||||
@@ -474,9 +482,10 @@ class XCXCAEASignaller : XCBase
|
|||||||
canTriggerCond1 = CanTriggerCond1(
|
canTriggerCond1 = CanTriggerCond1(
|
||||||
helper,
|
helper,
|
||||||
conditions.decisionZone,
|
conditions.decisionZone,
|
||||||
|
decisionPivots,
|
||||||
triggerDir,
|
triggerDir,
|
||||||
sl,
|
sl,
|
||||||
tp,
|
targets,
|
||||||
iObjects,
|
iObjects,
|
||||||
barIndex //
|
barIndex //
|
||||||
);
|
);
|
||||||
@@ -491,10 +500,10 @@ class XCXCAEASignaller : XCBase
|
|||||||
canTriggerCond2 = CanTriggerCond2(
|
canTriggerCond2 = CanTriggerCond2(
|
||||||
helper,
|
helper,
|
||||||
conditions.decisionZone,
|
conditions.decisionZone,
|
||||||
decisionOBs,
|
decisionPivots,
|
||||||
triggerDir,
|
triggerDir,
|
||||||
sl,
|
sl,
|
||||||
tp,
|
targets,
|
||||||
iObjects,
|
iObjects,
|
||||||
barIndex //
|
barIndex //
|
||||||
);
|
);
|
||||||
@@ -503,24 +512,6 @@ class XCXCAEASignaller : XCBase
|
|||||||
//
|
//
|
||||||
// Checking Trigger Cond 3 ...
|
// Checking Trigger Cond 3 ...
|
||||||
bool canTriggerCond3 = false;
|
bool canTriggerCond3 = false;
|
||||||
// CanTriggerCond3(
|
|
||||||
// helper,
|
|
||||||
// conditions.decisionZone,
|
|
||||||
// triggerDir,
|
|
||||||
// sl,
|
|
||||||
// tp,
|
|
||||||
// iObjects,
|
|
||||||
// barIndex //
|
|
||||||
// );
|
|
||||||
|
|
||||||
//
|
|
||||||
// Draw Decision Zone ...
|
|
||||||
drawer.DrawBox(
|
|
||||||
conditions.decisionZone,
|
|
||||||
cTime,
|
|
||||||
true, // Draw Middle Line ...
|
|
||||||
true // Ignore Type ...
|
|
||||||
);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Adding Drawn Objects to Drawn Stores ...
|
// Adding Drawn Objects to Drawn Stores ...
|
||||||
@@ -557,16 +548,6 @@ class XCXCAEASignaller : XCBase
|
|||||||
);
|
);
|
||||||
conditions.entry = entry;
|
conditions.entry = entry;
|
||||||
|
|
||||||
//
|
|
||||||
if (tp > 0.0)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
Add(
|
|
||||||
tp,
|
|
||||||
conditions.targets //
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
double spred = GetSpread(conditions.symbol);
|
double spred = GetSpread(conditions.symbol);
|
||||||
|
|
||||||
@@ -578,28 +559,28 @@ class XCXCAEASignaller : XCBase
|
|||||||
? entry + reward
|
? entry + reward
|
||||||
: entry - reward;
|
: entry - reward;
|
||||||
|
|
||||||
//
|
// //
|
||||||
// Handling RF ...
|
// // Handling RF ...
|
||||||
double rfReward = risk * 1.95;
|
// double rfReward = risk * 1.95;
|
||||||
double rfPrice =
|
// double rfPrice =
|
||||||
isBullish
|
// isBullish
|
||||||
? entry + rfReward
|
// ? entry + rfReward
|
||||||
: entry - rfReward;
|
// : entry - rfReward;
|
||||||
Add(
|
// Add(
|
||||||
rfPrice,
|
// rfPrice,
|
||||||
conditions.targets //
|
// conditions.targets //
|
||||||
);
|
// );
|
||||||
|
|
||||||
//
|
// //
|
||||||
rfReward = risk * 2.95;
|
// rfReward = risk * 2.95;
|
||||||
rfPrice =
|
// rfPrice =
|
||||||
isBullish
|
// isBullish
|
||||||
? entry + rfReward
|
// ? entry + rfReward
|
||||||
: entry - rfReward;
|
// : entry - rfReward;
|
||||||
Add(
|
// Add(
|
||||||
rfPrice,
|
// rfPrice,
|
||||||
conditions.targets //
|
// conditions.targets //
|
||||||
);
|
// );
|
||||||
|
|
||||||
//
|
//
|
||||||
// Handling Partial Close ...
|
// Handling Partial Close ...
|
||||||
@@ -615,6 +596,18 @@ class XCXCAEASignaller : XCBase
|
|||||||
? X_POSITION_TYPE_LONG
|
? X_POSITION_TYPE_LONG
|
||||||
: X_POSITION_TYPE_SHORT;
|
: X_POSITION_TYPE_SHORT;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Handling Targets ...
|
||||||
|
bool hasTargets = HasChild(targets);
|
||||||
|
if (hasTargets)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
Copy(
|
||||||
|
targets,
|
||||||
|
conditions.targets //
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user