This commit is contained in:
2024-06-30 10:59:34 +03:30
parent 03aabb7bdc
commit 31a7f27384
3 changed files with 85 additions and 64 deletions
+31 -13
View File
@@ -1910,6 +1910,7 @@ public:
}
//
data[infoIDX].volume = signal.volume;
data[infoIDX].ticket = signal.positionId;
//
@@ -1948,10 +1949,14 @@ public:
//
// Here we Prepare Handler Structure for
// Next Grid Position ...
data[infoIDX].PrepareNextGrid(
GridDistance(),
GridVolumeMultiplier() //
);
if (data[infoIDX].allowGrid)
{
//
data[infoIDX].PrepareNextGrid(
GridDistance(),
GridVolumeMultiplier() //
);
}
}
//
@@ -1959,11 +1964,15 @@ public:
if (EnableRecovery())
{
//
data[infoIDX].PrepareNextRecovery(
GridDistance(),
GridVolumeMultiplier(),
signal.type //
);
if (data[infoIDX].allowRecover)
{
//
data[infoIDX].PrepareNextRecovery(
GridDistance(),
GridVolumeMultiplier(),
signal.type //
);
}
}
}
@@ -3770,19 +3779,23 @@ public:
}
//
double MaxAllowedDrawdownPercent() {
double MaxAllowedDrawdownPercent()
{
return mMaxAllowedDrawdownPercent;
}
//
void MaxAllowedDrawdownPercent(double value) {
void MaxAllowedDrawdownPercent(double value)
{
//
if (value < 0) {
if (value < 0)
{
value = 0;
}
//
if (value > 50) {
if (value > 50)
{
value = 50;
}
@@ -4153,6 +4166,7 @@ public:
if (cHasSignal)
{
//
signal.Clean();
signal = cSignal;
//
@@ -4170,6 +4184,7 @@ public:
if (sHasSignal)
{
//
signal.Clean();
signal = sSignal;
//
@@ -4187,6 +4202,7 @@ public:
if (mHasSignal)
{
//
signal.Clean();
signal = mSignal;
//
@@ -4204,6 +4220,7 @@ public:
if (lHasSignal)
{
//
signal.Clean();
signal = lSignal;
//
@@ -4221,6 +4238,7 @@ public:
if (hHasSignal)
{
//
signal.Clean();
signal = hSignal;
//
+37 -34
View File
@@ -1102,7 +1102,10 @@ public:
//
// Prepare Signal Comment ...
string mSComment = mSignal.GenerateComment();
mSignal.comment += mSComment;
if (!Contains(mSComment, mSignal.comment))
{
mSignal.comment += mSComment;
}
//
// Handle Market Execution ...
@@ -1841,12 +1844,12 @@ public:
//
// Close Specified Positions ...
int Close(
string comment = NULL, // Close Position By Specific Comment
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
string comment = NULL, // Close Position By Specific Comment
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
ENUM_X_POSITION_TYPES type = NULL, // Long (Buy) or Short (Sell)
bool filterByMagic = true // Get Only Self Open Positions
bool filterByMagic = true // Get Only Self Open Positions
)
{
//
@@ -2031,11 +2034,11 @@ public:
//
// Calculate Positions Profit ...
double Profit(
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
ENUM_X_POSITION_TYPES type = NULL, // Long (Buy) or Short (Sell)
bool filterByMagic = true // Get Only Self Open Positions
bool filterByMagic = true // Get Only Self Open Positions
)
{
//
@@ -2095,13 +2098,13 @@ public:
//
// Retrieve Positions ...
int GetPositions(
XPosition &result[], // Hold's Result
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
XPosition &result[], // Hold's Result
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
ENUM_X_POSITION_TYPES type = NULL, // Long (Buy) or Short (Sell)
bool filterByMagic = true, // Get Only Self Open Positions
bool forceClean = true // Clean Result Array
bool filterByMagic = true, // Get Only Self Open Positions
bool forceClean = true // Clean Result Array
)
{
//
@@ -2215,7 +2218,7 @@ public:
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
ENUM_X_POSITION_TYPES type = NULL, // Long (Buy) or Short (Sell)
ENUM_X_POSITION_TYPES type = NULL, // Long (Buy) or Short (Sell)
ENUM_X_POSITION_SELECT_METHODS method = NULL, // Selection Method
bool filterByMagic = true, // Get Only Self Open Positions
bool forceClean = true // Clean Result Array
@@ -2346,7 +2349,7 @@ public:
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
ENUM_X_POSITION_TYPES type = NULL, // Long (Buy) or Short (Sell)
ENUM_X_POSITION_TYPES type = NULL, // Long (Buy) or Short (Sell)
ENUM_X_POSITION_SELECT_METHODS method = NULL, // Selection Method
bool filterByMagic = true, // Get Only Self Open Positions
bool forceClean = true // Clean Result Array
@@ -2563,14 +2566,14 @@ public:
//
// Retrieve All Orders ...
int GetOrders(
XOrder &result[], // Hold's Result
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
XOrder &result[], // Hold's Result
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
ENUM_X_POSITION_TYPES type = NULL, // Long (Buy) or Short (Sell)
ENUM_ORDER_STATE state = NULL, // Order State
bool filterByMagic = true, // Get Only Self Open Positions
bool forceClean = true // Clean Result Array
ENUM_ORDER_STATE state = NULL, // Order State
bool filterByMagic = true, // Get Only Self Open Positions
bool forceClean = true // Clean Result Array
)
{
//
@@ -2645,16 +2648,16 @@ public:
//
// Retrieve Historical Orders ...
int GetOrders(
XOrder &result[], // Hold's Result
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
XOrder &result[], // Hold's Result
string symbol = NULL, // Trading Symbol
string provider = NULL, // Signal Provider
ENUM_TIMEFRAMES period = NULL, // Trading Period
ENUM_X_POSITION_TYPES type = NULL, // Long (Buy) or Short (Sell)
ENUM_ORDER_STATE state = NULL, // Order State
datetime startDate = NULL, // Specify Start Date
datetime endDate = NULL, // Specify End Date
bool filterByMagic = true, // Get Only Self Open Positions
bool forceClean = true // Clean Result Array
ENUM_ORDER_STATE state = NULL, // Order State
datetime startDate = NULL, // Specify Start Date
datetime endDate = NULL, // Specify End Date
bool filterByMagic = true, // Get Only Self Open Positions
bool forceClean = true // Clean Result Array
)
{
//