last ...
This commit is contained in:
@@ -554,6 +554,7 @@ class XCXCATBEASignaller : XCBase
|
||||
helper.Update(barIndex);
|
||||
|
||||
//
|
||||
bool has = false;
|
||||
datetime cTime = TimeCurrent();
|
||||
|
||||
//
|
||||
@@ -746,7 +747,86 @@ class XCXCATBEASignaller : XCBase
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
// Filling Conditions of Strategy ...
|
||||
// Use Signal Zone ...
|
||||
UseBox(mConditions.pivotZone);
|
||||
|
||||
//
|
||||
// Prepare Condition ...
|
||||
|
||||
//
|
||||
// Prepare Signal ...
|
||||
mConditions.dir =
|
||||
mConditions
|
||||
.pivotZone
|
||||
.dir;
|
||||
mConditions.symbol = symbol;
|
||||
mConditions.period = period;
|
||||
mConditions.provider = provider;
|
||||
mConditions.reward = riskToRewardRatio;
|
||||
mConditions.time = mConditions.conditions.bars[0].time;
|
||||
mConditions.setupTime = mConditions.conditions.bars[0].time;
|
||||
|
||||
//
|
||||
// Prepare Target ...
|
||||
double targets[];
|
||||
for (int i = 1; i <= riskToRewardRatio; i++)
|
||||
{
|
||||
//
|
||||
Add(
|
||||
(double)i,
|
||||
targets //
|
||||
);
|
||||
}
|
||||
|
||||
//
|
||||
// Calculate SL Additions ...
|
||||
double iATR = 0;
|
||||
if (barIndex > 0 &&
|
||||
barIndex < ArraySize(helper.atrBuffer))
|
||||
{
|
||||
iATR = helper.atrBuffer[barIndex];
|
||||
}
|
||||
double slAdditional = slATRMultiplier * iATR;
|
||||
|
||||
//
|
||||
// Preparing Signal ...
|
||||
XSignal iSignal;
|
||||
result = ToSignal(
|
||||
mConditions.pivotZone,
|
||||
iSignal,
|
||||
targets,
|
||||
slAdditional //
|
||||
);
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
mConditions.sl = iSignal.sl;
|
||||
mConditions.tp = iSignal.tp;
|
||||
mConditions.pivot = iSignal.sl;
|
||||
mConditions.entry = iSignal.entry;
|
||||
mConditions.point = iSignal.entry;
|
||||
mConditions.type = ToPositionType(iSignal.type);
|
||||
|
||||
//
|
||||
// Draw Trigger Block ...
|
||||
if (allowDraws)
|
||||
{
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
has = drawer
|
||||
.drawer
|
||||
.DrawBox(
|
||||
mConditions.pivotZone,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
mObjects.Add(iObj);
|
||||
}
|
||||
ZeroMemory(iObj);
|
||||
}
|
||||
}
|
||||
iSignal.Clean();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1395,9 +1475,15 @@ class XCXCATBEASignaller : XCBase
|
||||
}
|
||||
|
||||
//
|
||||
bool has = false;
|
||||
datetime cTime = TimeCurrent();
|
||||
bool isBullish = IsBullish(conditions.dir);
|
||||
bool isBearish = IsBearish(conditions.dir);
|
||||
|
||||
//
|
||||
bool isBasedOnPivotZone = conditions.pivotZone.IsValid();
|
||||
bool isBasedOnTriggerBlock = conditions.triggerBlock.IsValid();
|
||||
|
||||
//
|
||||
// Validate Direction of Setuped Conditions ...
|
||||
result =
|
||||
@@ -1408,7 +1494,7 @@ class XCXCATBEASignaller : XCBase
|
||||
//
|
||||
// Do Triggering Senario based on Trigger Block ...
|
||||
if (result &&
|
||||
conditions.triggerBlock.IsValid())
|
||||
isBasedOnTriggerBlock)
|
||||
{
|
||||
//
|
||||
// Checking Score ...
|
||||
@@ -1433,6 +1519,32 @@ class XCXCATBEASignaller : XCBase
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Do Triggering based on Market Conditions PivotZones ...
|
||||
if (result &&
|
||||
isBasedOnPivotZone)
|
||||
{
|
||||
//
|
||||
// Update Box To ...
|
||||
conditions.pivotZone.to = cTime;
|
||||
|
||||
//
|
||||
// Draw Box ...
|
||||
XCBoxObject *iObj;
|
||||
has = drawer
|
||||
.drawer
|
||||
.DrawBox(
|
||||
conditions.pivotZone,
|
||||
iObj //
|
||||
);
|
||||
if (has)
|
||||
{
|
||||
mObjects.Add(iObj);
|
||||
}
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
//
|
||||
// Do Other Validation Senarios ...
|
||||
|
||||
@@ -1445,6 +1557,14 @@ class XCXCATBEASignaller : XCBase
|
||||
// Check Setup Age or Setup Validations here ...
|
||||
if (!result)
|
||||
{
|
||||
//
|
||||
// Validate Trigger Block Based Setups ...
|
||||
|
||||
//
|
||||
// Validate Pivot Zone Based Setups ...
|
||||
|
||||
//
|
||||
// Validate Setup Age ...
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -1379,7 +1379,7 @@ bool DetectSignalZone(
|
||||
|
||||
//
|
||||
Print("Conditions ...");
|
||||
signalZone.Clean();
|
||||
// signalZone.Clean();
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user