last works on adding threshold to pivots ...

This commit is contained in:
2024-07-11 08:31:23 +03:30
parent 9ab980be84
commit 827697dae7
3 changed files with 1401 additions and 1077 deletions
+88 -62
View File
@@ -60,8 +60,8 @@ XPivot lastResistancePivot;
//
// For Zone Checking ...
XZone lastSupportZone;
XZone lastResistanceZone;
// XZone lastSupportZone;
// XZone lastResistanceZone;
//
XTrendDetector trendDetector;
@@ -151,7 +151,7 @@ void OnTick()
//
// Check Pivots ...
// HandleCheckPivots();
HandleCheckPivots();
//
// Check Zones ...
@@ -163,7 +163,7 @@ void OnTick()
//
// Check Trend State ...
HandleCheckTrend();
// HandleCheckTrend();
}
//
@@ -413,8 +413,6 @@ void HandleCheckPivots()
);
if (!isInited)
{
//
lastResistancePivot.Clean();
return;
}
@@ -424,6 +422,26 @@ void HandleCheckPivots()
{
Print("Valid Resistance ...");
}
} else {
//
bool isBreaked = lastResistancePivot.IsBreaked();
bool isRejected = lastResistancePivot.IsRejected();
//
if (isBreaked)
{
//
// lastResistancePivot.Clean();
Print("Resistance Breaked ...");
}
//
if (isRejected)
{
//
// lastResistancePivot.Clean();
Print("Resistance Rejected ...");
}
}
//
@@ -437,8 +455,6 @@ void HandleCheckPivots()
);
if (!isInited)
{
//
lastSupportPivot.Clean();
return;
}
@@ -459,7 +475,7 @@ void HandleCheckPivots()
if (isBreaked)
{
//
lastSupportPivot.Clean();
// lastSupportPivot.Clean();
Print("Support Breaked ...");
}
@@ -467,7 +483,7 @@ void HandleCheckPivots()
if (isRejected)
{
//
lastSupportPivot.Clean();
// lastSupportPivot.Clean();
Print("Support Rejected ...");
}
}
@@ -476,58 +492,58 @@ void HandleCheckPivots()
//
void HandleCheckZones()
{
//
bool result = false;
// //
// bool result = false;
//
// Find Last Support Zone ...
if (!lastSupportZone.IsValid())
{
//
result = lastSupportZone.FindLastSupportZone(
_Symbol,
_Period //
);
if (!result)
{
return;
}
// //
// // Find Last Support Zone ...
// if (!lastSupportZone.IsValid())
// {
// //
// result = lastSupportZone.FindLastSupportZone(
// _Symbol,
// _Period //
// );
// if (!result)
// {
// return;
// }
//
result = lastSupportZone.Draw(ChartID());
if (result)
{
Print("Valid Support Zone ...");
}
}
else
{
}
// //
// result = lastSupportZone.Draw(ChartID());
// if (result)
// {
// Print("Valid Support Zone ...");
// }
// }
// else
// {
// }
//
// Find Last Resistance Zone ...
if (!lastResistanceZone.IsValid())
{
//
result = lastResistanceZone.FindLastResistanceZone(
_Symbol,
_Period //
);
if (!result)
{
return;
}
// //
// // Find Last Resistance Zone ...
// if (!lastResistanceZone.IsValid())
// {
// //
// result = lastResistanceZone.FindLastResistanceZone(
// _Symbol,
// _Period //
// );
// if (!result)
// {
// return;
// }
//
result = lastResistanceZone.Draw(ChartID());
if (result)
{
Print("Valid Resistance Zone ...");
}
}
else
{
}
// //
// result = lastResistanceZone.Draw(ChartID());
// if (result)
// {
// Print("Valid Resistance Zone ...");
// }
// }
// else
// {
// }
}
//
@@ -573,10 +589,20 @@ void HandleCheckTimeTracker()
void HandleCheckTrend()
{
//
bool hasTren = trendDetector.FindTrend(
_Symbol,
_Period //
);
bool hasTrend = trendDetector.HasTrend();
if (!hasTrend)
{
//
bool trendFound = trendDetector.FindTrend(
_Symbol,
_Period //
);
}
else
{
//
Print("Has Trend: " + (trendDetector.isUpTrend ? "Bullish" : "Bearish"));
}
}
//