last ...
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -4032,7 +4032,7 @@ public:
|
||||
// Handle Support of Supports here ...
|
||||
void OnPositionsChangedHandler(int count) override
|
||||
{
|
||||
EQMHandleSupportProtection(count);
|
||||
// EQMHandleSupportProtection(count);
|
||||
}
|
||||
|
||||
//
|
||||
@@ -4784,9 +4784,8 @@ private:
|
||||
}
|
||||
|
||||
//
|
||||
bool isDIRInDIRSupport = position.provider == XEQMSupportToken + XDirectionalToken ||
|
||||
position.provider == XEQMSupportToken + XINDirectionalToken;
|
||||
if (!isDIRInDIRSupport)
|
||||
bool isINDIRSupport = position.provider == XEQMSupportToken + XINDirectionalToken;
|
||||
if (!isINDIRSupport)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -4828,7 +4827,7 @@ private:
|
||||
//
|
||||
XSignal signal;
|
||||
X121SignalGenerator signalGenerator;
|
||||
bool hasSupport = signalGenerator.UpdateSupportSignals(
|
||||
bool hasSupport = signalGenerator.PrepareDirectionalSupportSignals(
|
||||
position,
|
||||
parent,
|
||||
signal //
|
||||
|
||||
@@ -1099,16 +1099,16 @@ protected:
|
||||
|
||||
//
|
||||
// Check At Least One Support Positions Open For Hedging ...
|
||||
XPosition supports[];
|
||||
int supportsCount = ExtractSupports(
|
||||
positions,
|
||||
supports //
|
||||
);
|
||||
result = IsValidSize(supportsCount);
|
||||
if (!result)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
// XPosition supports[];
|
||||
// int supportsCount = ExtractSupports(
|
||||
// positions,
|
||||
// supports //
|
||||
// );
|
||||
// result = IsValidSize(supportsCount);
|
||||
// if (!result)
|
||||
// {
|
||||
// return result;
|
||||
// }
|
||||
|
||||
//
|
||||
double profits = SpecifiedCalculatePositionsProfit(positions);
|
||||
@@ -1139,6 +1139,9 @@ protected:
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
SyncSupports();
|
||||
|
||||
//
|
||||
string message = XEQMSupportToken + " Hedge: " + ToString(profits) + " ...";
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
//
|
||||
Reference in New Issue
Block a user