This commit is contained in:
2024-06-21 06:45:33 +03:30
parent e9e313fa58
commit a5cb716d0b
7 changed files with 1268 additions and 761 deletions
+132 -6
View File
@@ -120,7 +120,8 @@ public:
//
// Deconstructor ...
void ~XSCTrend() {
void ~XSCTrend()
{
Remove();
}
@@ -340,6 +341,77 @@ public:
return result;
}
//
// Retrieve Chart Line Values ...
//
// Get Lows Line Price at Specific Time ...
double GetLows(datetime time = NULL)
{
//
double result = 0;
//
result = GetObjectPrice(
lowsName,
time //
);
//
return result;
}
//
// Get Highs Line Price at Specific Time ...
double GetHighs(datetime time = NULL)
{
//
double result = 0;
//
result = GetObjectPrice(
highsName,
time //
);
//
return result;
}
//
// Get Support Line Price at Specific Time ...
double GetSupport(datetime time = NULL)
{
//
double result = 0;
//
result = GetObjectPrice(
supportName,
time //
);
//
return result;
}
//
// Get Resistance Line Price at Specific Time ...
double GetResistance(datetime time = NULL)
{
//
double result = 0;
//
result = GetObjectPrice(
resistanceName,
time //
);
//
return result;
}
//
// Remove Draws ...
bool Remove(
@@ -377,6 +449,7 @@ public:
}
//
// Draw Trend Object on Chart ...
bool Draw(
long chartId = 0,
string prefix = NULL,
@@ -438,7 +511,7 @@ public:
secondSwingLowBar.time > secondSwingHighBar.time
? secondSwingHighBar.time
: secondSwingLowBar.time;
string supportName =
supportName =
//
identifier +
(IsSpecifiedValid(prefix)
@@ -455,8 +528,7 @@ public:
secondSwingLowBar.time > secondSwingHighBar.time
? secondSwingHighBar.time
: secondSwingLowBar.time;
string resistanceName =
resistanceName =
//
identifier +
(IsSpecifiedValid(prefix)
@@ -474,7 +546,7 @@ public:
//
double oldLow = secondSwingLowBar.low;
datetime oldLowTime = secondSwingLowBar.time;
string lowsName =
lowsName =
//
identifier +
(IsSpecifiedValid(prefix)
@@ -492,7 +564,7 @@ public:
//
double oldHigh = secondSwingHighBar.high;
datetime oldHighTime = secondSwingHighBar.time;
string highsName =
highsName =
//
identifier +
(IsSpecifiedValid(prefix)
@@ -598,6 +670,53 @@ public:
//
// Protected ...
protected:
//
// Tools ...
//
double GetObjectPrice(
string objName,
datetime objTime,
long chartId = 0,
int subWindow = 0 //
)
{
//
double result = 0;
//
if (!IsValid())
{
return result;
}
//
if (!IsSpecifiedValid(objName))
{
return result;
}
//
objTime = NormalizeTime(objTime);
//
string objectName = FindObjectName(
objName,
chartId,
subWindow //
);
//
result = ObjectGetValueByTime(
chartId,
objectName,
objTime //
);
//
return result;
}
//
// Private ...
private:
@@ -615,6 +734,13 @@ private:
XOHCL secondSwingLowBar;
XOHCL firstSwingHighBar;
XOHCL secondSwingHighBar;
//
// Object Names ...
string lowsName;
string highsName;
string supportName;
string resistanceName;
};
//