last ...
This commit is contained in:
@@ -430,49 +430,49 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
workingZone.HasBreakedZones();
|
||||
if (hasBreakedZones)
|
||||
{
|
||||
// //
|
||||
// if (!hasSelectedZone)
|
||||
// {
|
||||
// //
|
||||
// int selectedIDX = -1;
|
||||
// int count = workingZone.CountBreakedZones();
|
||||
// for (int i = 0; i < count; i++)
|
||||
// {
|
||||
// //
|
||||
// bool has = DetectSelectedZoneConditions(
|
||||
// isSelectedZoneReversal,
|
||||
// workingZone.breakedZones[i],
|
||||
// decisionState,
|
||||
// decisionXConditions //
|
||||
// );
|
||||
|
||||
if (!hasSelectedZone)
|
||||
{
|
||||
//
|
||||
int selectedIDX = -1;
|
||||
int count = workingZone.CountBreakedZones();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
//
|
||||
bool has = DetectSelectedZoneConditions(
|
||||
isSelectedZoneReversal,
|
||||
workingZone.breakedZones[i],
|
||||
decisionState,
|
||||
decisionXConditions //
|
||||
);
|
||||
// //
|
||||
// if (has)
|
||||
// {
|
||||
// //
|
||||
// selectedIDX = i;
|
||||
// selectedZone = workingZone.breakedZones[i];
|
||||
|
||||
//
|
||||
if (has)
|
||||
{
|
||||
//
|
||||
selectedIDX = i;
|
||||
selectedZone = workingZone.breakedZones[i];
|
||||
// //
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
//
|
||||
break;
|
||||
}
|
||||
}
|
||||
// //
|
||||
// if (IsValidIndex(selectedIDX))
|
||||
// {
|
||||
// //
|
||||
// ArrayRemove(
|
||||
// workingZone.breakedZones,
|
||||
// selectedIDX,
|
||||
// 1 //
|
||||
// );
|
||||
|
||||
//
|
||||
if (IsValidIndex(selectedIDX))
|
||||
{
|
||||
//
|
||||
ArrayRemove(
|
||||
workingZone.breakedZones,
|
||||
selectedIDX,
|
||||
1 //
|
||||
);
|
||||
|
||||
//
|
||||
hasSelectedZone = selectedZone.IsValid();
|
||||
provider = X121SMC_XWZ_PROVIDER_ACTIVATED_ZONE;
|
||||
}
|
||||
}
|
||||
// //
|
||||
// hasSelectedZone = selectedZone.IsValid();
|
||||
// provider = X121SMC_XWZ_PROVIDER_ACTIVATED_ZONE;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
//
|
||||
@@ -667,6 +667,11 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
if (!hasSignalBox)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
@@ -771,6 +776,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
selectedZone,
|
||||
selectedZoneDir,
|
||||
workingZone,
|
||||
decisionXConditions,
|
||||
zIndex,
|
||||
maxAllowedSLDistanceInPoint //
|
||||
);
|
||||
@@ -824,132 +830,132 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
//
|
||||
if (hasSignalBox)
|
||||
{
|
||||
//
|
||||
workingZone.mInsideZoneObjects.Clear();
|
||||
workingZone.mBreakedZoneObjects.Clear();
|
||||
workingZone.mWaitingZoneObjects.Clear();
|
||||
workingZone.mWorkingZoneObjects.Clear();
|
||||
// //
|
||||
// workingZone.mInsideZoneObjects.Clear();
|
||||
// workingZone.mBreakedZoneObjects.Clear();
|
||||
// workingZone.mWaitingZoneObjects.Clear();
|
||||
// workingZone.mWorkingZoneObjects.Clear();
|
||||
|
||||
//
|
||||
XCBoxObject *iObj;
|
||||
signalBox.to = cTime;
|
||||
bool isCreated = drawer.CreateBox(
|
||||
signalBox,
|
||||
iObj //
|
||||
);
|
||||
// //
|
||||
// XCBoxObject *iObj;
|
||||
// signalBox.to = cTime;
|
||||
// bool isCreated = drawer.CreateBox(
|
||||
// signalBox,
|
||||
// iObj //
|
||||
// );
|
||||
|
||||
//
|
||||
if (isCreated)
|
||||
{
|
||||
//
|
||||
iObj.BoxWidth(2);
|
||||
iObj.BoxColor(clrYellow);
|
||||
iObj.BoxStyle(STYLE_SOLID);
|
||||
}
|
||||
// //
|
||||
// if (isCreated)
|
||||
// {
|
||||
// //
|
||||
// iObj.BoxWidth(2);
|
||||
// iObj.BoxColor(clrYellow);
|
||||
// iObj.BoxStyle(STYLE_SOLID);
|
||||
// }
|
||||
|
||||
//
|
||||
bool isSignalBoxBullishDir = signalBox.IsBullish();
|
||||
// //
|
||||
// bool isSignalBoxBullishDir = signalBox.IsBullish();
|
||||
|
||||
//
|
||||
// Calculate Priority ...
|
||||
hasPriority =
|
||||
hasWorkingZone &&
|
||||
workingZone
|
||||
.DetectPriority(
|
||||
priority,
|
||||
signalBox.dir,
|
||||
zIndex,
|
||||
period //
|
||||
);
|
||||
// //
|
||||
// // Calculate Priority ...
|
||||
// hasPriority =
|
||||
// hasWorkingZone &&
|
||||
// workingZone
|
||||
// .DetectPriority(
|
||||
// priority,
|
||||
// signalBox.dir,
|
||||
// zIndex,
|
||||
// period //
|
||||
// );
|
||||
|
||||
//
|
||||
// Calculate Risk Reward Ration based on Priority ...
|
||||
hasRewardAmount = CalculateRiskReward(
|
||||
priority,
|
||||
reward,
|
||||
amountPercent //
|
||||
);
|
||||
// //
|
||||
// // Calculate Risk Reward Ration based on Priority ...
|
||||
// hasRewardAmount = CalculateRiskReward(
|
||||
// priority,
|
||||
// reward,
|
||||
// amountPercent //
|
||||
// );
|
||||
|
||||
//
|
||||
// Calculate Pivot and Point ...
|
||||
// //
|
||||
// // Calculate Pivot and Point ...
|
||||
|
||||
//
|
||||
pivot =
|
||||
isSignalBoxBullishDir
|
||||
? signalBox.lower
|
||||
: signalBox.upper;
|
||||
// //
|
||||
// pivot =
|
||||
// isSignalBoxBullishDir
|
||||
// ? signalBox.lower
|
||||
// : signalBox.upper;
|
||||
|
||||
//
|
||||
point =
|
||||
isSignalBoxBullishDir
|
||||
? signalBox.upper
|
||||
: signalBox.lower;
|
||||
// //
|
||||
// point =
|
||||
// isSignalBoxBullishDir
|
||||
// ? signalBox.upper
|
||||
// : signalBox.lower;
|
||||
|
||||
//
|
||||
double defaultTarget =
|
||||
isSignalBoxBullishDir
|
||||
? signalBox.upper
|
||||
: signalBox.lower;
|
||||
Add(
|
||||
defaultTarget,
|
||||
targets //
|
||||
);
|
||||
// //
|
||||
// double defaultTarget =
|
||||
// isSignalBoxBullishDir
|
||||
// ? signalBox.upper
|
||||
// : signalBox.lower;
|
||||
// Add(
|
||||
// defaultTarget,
|
||||
// targets //
|
||||
// );
|
||||
|
||||
//
|
||||
// Detect SLs ...
|
||||
double iAtr = decisionXConditions.atrBuffer[0];
|
||||
iAtr *= 1.5;
|
||||
// //
|
||||
// // Detect SLs ...
|
||||
// double iAtr = decisionXConditions.atrBuffer[0];
|
||||
// iAtr *= 1.5;
|
||||
|
||||
//
|
||||
double defaultSL =
|
||||
isSignalBoxBullishDir
|
||||
? decisionXConditions.valesBuffer[0] - iAtr
|
||||
: decisionXConditions.peaksBuffer[0] + iAtr;
|
||||
// //
|
||||
// double defaultSL =
|
||||
// isSignalBoxBullishDir
|
||||
// ? decisionXConditions.valesBuffer[0] - iAtr
|
||||
// : decisionXConditions.peaksBuffer[0] + iAtr;
|
||||
|
||||
//
|
||||
Add(
|
||||
defaultSL,
|
||||
sls //
|
||||
);
|
||||
// //
|
||||
// Add(
|
||||
// defaultSL,
|
||||
// sls //
|
||||
// );
|
||||
|
||||
//
|
||||
// Summaries Conditions ...
|
||||
result =
|
||||
pivot > 0 &&
|
||||
point > 0 &&
|
||||
hasPriority &&
|
||||
hasRewardAmount;
|
||||
if (result)
|
||||
{
|
||||
//
|
||||
isBullish = signalBox.IsBullish();
|
||||
isBearish = signalBox.IsBearish();
|
||||
// //
|
||||
// // Summaries Conditions ...
|
||||
// result =
|
||||
// pivot > 0 &&
|
||||
// point > 0 &&
|
||||
// hasPriority &&
|
||||
// hasRewardAmount;
|
||||
// if (result)
|
||||
// {
|
||||
// //
|
||||
// isBullish = signalBox.IsBullish();
|
||||
// isBearish = signalBox.IsBearish();
|
||||
|
||||
//
|
||||
Copy(
|
||||
sls,
|
||||
mConditions.sls //
|
||||
);
|
||||
Copy(
|
||||
targets,
|
||||
mConditions.targets //
|
||||
);
|
||||
// //
|
||||
// Copy(
|
||||
// sls,
|
||||
// mConditions.sls //
|
||||
// );
|
||||
// Copy(
|
||||
// targets,
|
||||
// mConditions.targets //
|
||||
// );
|
||||
|
||||
//
|
||||
mConditions.pivot = pivot;
|
||||
mConditions.point = point;
|
||||
mConditions.reward = reward;
|
||||
mConditions.setupTime = cTime;
|
||||
mConditions.priority = priority;
|
||||
mConditions.provider = provider;
|
||||
mConditions.dir = signalBox.dir;
|
||||
mConditions.signalBox = signalBox;
|
||||
mConditions.amountPercent = amountPercent;
|
||||
}
|
||||
// //
|
||||
// mConditions.pivot = pivot;
|
||||
// mConditions.point = point;
|
||||
// mConditions.reward = reward;
|
||||
// mConditions.setupTime = cTime;
|
||||
// mConditions.priority = priority;
|
||||
// mConditions.provider = provider;
|
||||
// mConditions.dir = signalBox.dir;
|
||||
// mConditions.signalBox = signalBox;
|
||||
// mConditions.amountPercent = amountPercent;
|
||||
// }
|
||||
|
||||
//
|
||||
signalBox.Clean();
|
||||
hasSignalBox = false;
|
||||
// //
|
||||
// signalBox.Clean();
|
||||
// hasSignalBox = false;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -967,8 +973,8 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
true, // Draw Breaked Zones ...
|
||||
true, // Draw Supply Zone ...
|
||||
true, // Draw Demand Zone ...
|
||||
true, // Draw Supply Zones ...
|
||||
true, // Draw Demand Zones ...
|
||||
false, // Draw Supply Zones ...
|
||||
false, // Draw Demand Zones ...
|
||||
false, // Draw Support Zones ...
|
||||
false // Draw Resistance Zones ...
|
||||
);
|
||||
@@ -1294,6 +1300,7 @@ class XCX121SMCXWZSignalDetector : public XCBase
|
||||
{
|
||||
//
|
||||
bool result = false;
|
||||
return false;
|
||||
|
||||
//
|
||||
Clean(guards);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user