last ...
This commit is contained in:
@@ -1910,6 +1910,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
data[infoIDX].volume = signal.volume;
|
||||||
data[infoIDX].ticket = signal.positionId;
|
data[infoIDX].ticket = signal.positionId;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1948,10 +1949,14 @@ public:
|
|||||||
//
|
//
|
||||||
// Here we Prepare Handler Structure for
|
// Here we Prepare Handler Structure for
|
||||||
// Next Grid Position ...
|
// Next Grid Position ...
|
||||||
data[infoIDX].PrepareNextGrid(
|
if (data[infoIDX].allowGrid)
|
||||||
GridDistance(),
|
{
|
||||||
GridVolumeMultiplier() //
|
//
|
||||||
);
|
data[infoIDX].PrepareNextGrid(
|
||||||
|
GridDistance(),
|
||||||
|
GridVolumeMultiplier() //
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -1959,11 +1964,15 @@ public:
|
|||||||
if (EnableRecovery())
|
if (EnableRecovery())
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
data[infoIDX].PrepareNextRecovery(
|
if (data[infoIDX].allowRecover)
|
||||||
GridDistance(),
|
{
|
||||||
GridVolumeMultiplier(),
|
//
|
||||||
signal.type //
|
data[infoIDX].PrepareNextRecovery(
|
||||||
);
|
GridDistance(),
|
||||||
|
GridVolumeMultiplier(),
|
||||||
|
signal.type //
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3770,19 +3779,23 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
double MaxAllowedDrawdownPercent() {
|
double MaxAllowedDrawdownPercent()
|
||||||
|
{
|
||||||
return mMaxAllowedDrawdownPercent;
|
return mMaxAllowedDrawdownPercent;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
void MaxAllowedDrawdownPercent(double value) {
|
void MaxAllowedDrawdownPercent(double value)
|
||||||
|
{
|
||||||
//
|
//
|
||||||
if (value < 0) {
|
if (value < 0)
|
||||||
|
{
|
||||||
value = 0;
|
value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
if (value > 50) {
|
if (value > 50)
|
||||||
|
{
|
||||||
value = 50;
|
value = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4153,6 +4166,7 @@ public:
|
|||||||
if (cHasSignal)
|
if (cHasSignal)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
signal.Clean();
|
||||||
signal = cSignal;
|
signal = cSignal;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -4170,6 +4184,7 @@ public:
|
|||||||
if (sHasSignal)
|
if (sHasSignal)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
signal.Clean();
|
||||||
signal = sSignal;
|
signal = sSignal;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -4187,6 +4202,7 @@ public:
|
|||||||
if (mHasSignal)
|
if (mHasSignal)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
signal.Clean();
|
||||||
signal = mSignal;
|
signal = mSignal;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -4204,6 +4220,7 @@ public:
|
|||||||
if (lHasSignal)
|
if (lHasSignal)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
signal.Clean();
|
||||||
signal = lSignal;
|
signal = lSignal;
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -4221,6 +4238,7 @@ public:
|
|||||||
if (hHasSignal)
|
if (hHasSignal)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
signal.Clean();
|
||||||
signal = hSignal;
|
signal = hSignal;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1102,7 +1102,10 @@ public:
|
|||||||
//
|
//
|
||||||
// Prepare Signal Comment ...
|
// Prepare Signal Comment ...
|
||||||
string mSComment = mSignal.GenerateComment();
|
string mSComment = mSignal.GenerateComment();
|
||||||
mSignal.comment += mSComment;
|
if (!Contains(mSComment, mSignal.comment))
|
||||||
|
{
|
||||||
|
mSignal.comment += mSComment;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Handle Market Execution ...
|
// Handle Market Execution ...
|
||||||
@@ -1841,12 +1844,12 @@ public:
|
|||||||
//
|
//
|
||||||
// Close Specified Positions ...
|
// Close Specified Positions ...
|
||||||
int Close(
|
int Close(
|
||||||
string comment = NULL, // Close Position By Specific Comment
|
string comment = NULL, // Close Position By Specific Comment
|
||||||
string symbol = NULL, // Trading Symbol
|
string symbol = NULL, // Trading Symbol
|
||||||
string provider = NULL, // Signal Provider
|
string provider = NULL, // Signal Provider
|
||||||
ENUM_TIMEFRAMES period = NULL, // Trading Period
|
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)
|
||||||
bool filterByMagic = true // Get Only Self Open Positions
|
bool filterByMagic = true // Get Only Self Open Positions
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -2031,11 +2034,11 @@ public:
|
|||||||
//
|
//
|
||||||
// Calculate Positions Profit ...
|
// Calculate Positions Profit ...
|
||||||
double Profit(
|
double Profit(
|
||||||
string symbol = NULL, // Trading Symbol
|
string symbol = NULL, // Trading Symbol
|
||||||
string provider = NULL, // Signal Provider
|
string provider = NULL, // Signal Provider
|
||||||
ENUM_TIMEFRAMES period = NULL, // Trading Period
|
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)
|
||||||
bool filterByMagic = true // Get Only Self Open Positions
|
bool filterByMagic = true // Get Only Self Open Positions
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -2095,13 +2098,13 @@ public:
|
|||||||
//
|
//
|
||||||
// Retrieve Positions ...
|
// Retrieve Positions ...
|
||||||
int GetPositions(
|
int GetPositions(
|
||||||
XPosition &result[], // Hold's Result
|
XPosition &result[], // Hold's Result
|
||||||
string symbol = NULL, // Trading Symbol
|
string symbol = NULL, // Trading Symbol
|
||||||
string provider = NULL, // Signal Provider
|
string provider = NULL, // Signal Provider
|
||||||
ENUM_TIMEFRAMES period = NULL, // Trading Period
|
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)
|
||||||
bool filterByMagic = true, // Get Only Self Open Positions
|
bool filterByMagic = true, // Get Only Self Open Positions
|
||||||
bool forceClean = true // Clean Result Array
|
bool forceClean = true // Clean Result Array
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -2215,7 +2218,7 @@ public:
|
|||||||
string symbol = NULL, // Trading Symbol
|
string symbol = NULL, // Trading Symbol
|
||||||
string provider = NULL, // Signal Provider
|
string provider = NULL, // Signal Provider
|
||||||
ENUM_TIMEFRAMES period = NULL, // Trading Period
|
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
|
ENUM_X_POSITION_SELECT_METHODS method = NULL, // Selection Method
|
||||||
bool filterByMagic = true, // Get Only Self Open Positions
|
bool filterByMagic = true, // Get Only Self Open Positions
|
||||||
bool forceClean = true // Clean Result Array
|
bool forceClean = true // Clean Result Array
|
||||||
@@ -2346,7 +2349,7 @@ public:
|
|||||||
string symbol = NULL, // Trading Symbol
|
string symbol = NULL, // Trading Symbol
|
||||||
string provider = NULL, // Signal Provider
|
string provider = NULL, // Signal Provider
|
||||||
ENUM_TIMEFRAMES period = NULL, // Trading Period
|
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
|
ENUM_X_POSITION_SELECT_METHODS method = NULL, // Selection Method
|
||||||
bool filterByMagic = true, // Get Only Self Open Positions
|
bool filterByMagic = true, // Get Only Self Open Positions
|
||||||
bool forceClean = true // Clean Result Array
|
bool forceClean = true // Clean Result Array
|
||||||
@@ -2563,14 +2566,14 @@ public:
|
|||||||
//
|
//
|
||||||
// Retrieve All Orders ...
|
// Retrieve All Orders ...
|
||||||
int GetOrders(
|
int GetOrders(
|
||||||
XOrder &result[], // Hold's Result
|
XOrder &result[], // Hold's Result
|
||||||
string symbol = NULL, // Trading Symbol
|
string symbol = NULL, // Trading Symbol
|
||||||
string provider = NULL, // Signal Provider
|
string provider = NULL, // Signal Provider
|
||||||
ENUM_TIMEFRAMES period = NULL, // Trading Period
|
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_ORDER_STATE state = NULL, // Order State
|
ENUM_ORDER_STATE state = NULL, // Order State
|
||||||
bool filterByMagic = true, // Get Only Self Open Positions
|
bool filterByMagic = true, // Get Only Self Open Positions
|
||||||
bool forceClean = true // Clean Result Array
|
bool forceClean = true // Clean Result Array
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
@@ -2645,16 +2648,16 @@ public:
|
|||||||
//
|
//
|
||||||
// Retrieve Historical Orders ...
|
// Retrieve Historical Orders ...
|
||||||
int GetOrders(
|
int GetOrders(
|
||||||
XOrder &result[], // Hold's Result
|
XOrder &result[], // Hold's Result
|
||||||
string symbol = NULL, // Trading Symbol
|
string symbol = NULL, // Trading Symbol
|
||||||
string provider = NULL, // Signal Provider
|
string provider = NULL, // Signal Provider
|
||||||
ENUM_TIMEFRAMES period = NULL, // Trading Period
|
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_ORDER_STATE state = NULL, // Order State
|
ENUM_ORDER_STATE state = NULL, // Order State
|
||||||
datetime startDate = NULL, // Specify Start Date
|
datetime startDate = NULL, // Specify Start Date
|
||||||
datetime endDate = NULL, // Specify End Date
|
datetime endDate = NULL, // Specify End Date
|
||||||
bool filterByMagic = true, // Get Only Self Open Positions
|
bool filterByMagic = true, // Get Only Self Open Positions
|
||||||
bool forceClean = true // Clean Result Array
|
bool forceClean = true // Clean Result Array
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ input int x121EASlippage = 10; // Slippgae
|
|||||||
// Symbols ...
|
// Symbols ...
|
||||||
input group "Symbol(s)";
|
input group "Symbol(s)";
|
||||||
input string x121EASymbols = "EURUSDb,USDCHFb,EURCHFb,USDJPYb,EURJPYb,GBPUSDb,EURGBPb,XAUUSDb,XAGUSDb,AUDUSDb,EURAUDb,USDCADb,EURCADb,NZDUSDb,EURNZDb"; // Symbols
|
input string x121EASymbols = "EURUSDb,USDCHFb,EURCHFb,USDJPYb,EURJPYb,GBPUSDb,EURGBPb,XAUUSDb,XAGUSDb,AUDUSDb,EURAUDb,USDCADb,EURCADb,NZDUSDb,EURNZDb"; // Symbols
|
||||||
input bool x121EAUseAllSymbols = false; // Use All Available Symbols
|
input bool x121EAUseAllSymbols = false; // Use All Available Symbols
|
||||||
input bool x121EAUseAllWatchListSymbols = false; // Use All Watch List Symbols
|
input bool x121EAUseAllWatchListSymbols = false; // Use All Watch List Symbols
|
||||||
|
|
||||||
//
|
//
|
||||||
// Signals ...
|
// Signals ...
|
||||||
@@ -83,13 +83,13 @@ input double x121EANextTrailDistance = 50; // Next Trailling Distance
|
|||||||
input double x121EANextTrailPoint = 25; // Next Trailling Step
|
input double x121EANextTrailPoint = 25; // Next Trailling Step
|
||||||
|
|
||||||
//
|
//
|
||||||
input group "Supporting";
|
// input group "Supporting";
|
||||||
input bool x121EAAllowSupport = false; // Allow Support Signals
|
// input bool x121EAAllowSupport = false; // Allow Support Signals
|
||||||
input bool x121EASupportOnlyForces = false; // Support Only Force Signals
|
// input bool x121EASupportOnlyForces = false; // Support Only Force Signals
|
||||||
double x121EASupportDistance = 0; // Supporting Distance
|
// double x121EASupportDistance = 0; // Supporting Distance
|
||||||
input int x121EAMaxNumberOfSupports = 0; // Max Number of Support Signals
|
// input int x121EAMaxNumberOfSupports = 0; // Max Number of Support Signals
|
||||||
input double x121EASupportVolumeMultiplier = 0; // Support Signals Volume Multiplier
|
// input double x121EASupportVolumeMultiplier = 0; // Support Signals Volume Multiplier
|
||||||
input double x121EAMaxAllowedSupportVolume = 0; // Max Allowed Support Signals Volume
|
// input double x121EAMaxAllowedSupportVolume = 0; // Max Allowed Support Signals Volume
|
||||||
|
|
||||||
//
|
//
|
||||||
input group "Grid";
|
input group "Grid";
|
||||||
@@ -349,14 +349,14 @@ bool InitialEA()
|
|||||||
x121EA.FirstTrailDistance(x121EAFirstTrailDistance);
|
x121EA.FirstTrailDistance(x121EAFirstTrailDistance);
|
||||||
x121EA.DisableTrailingWhenOpposit(x121EADisableTrailingWhenOpposit);
|
x121EA.DisableTrailingWhenOpposit(x121EADisableTrailingWhenOpposit);
|
||||||
|
|
||||||
//
|
// //
|
||||||
// Supporting ...
|
// // Supporting ...
|
||||||
x121EA.AllowSupport(x121EAAllowSupport);
|
// x121EA.AllowSupport(x121EAAllowSupport);
|
||||||
x121EA.SupportOnlyForces(x121EASupportOnlyForces);
|
// x121EA.SupportOnlyForces(x121EASupportOnlyForces);
|
||||||
x121EA.SupportDistance(x121EASupportDistance);
|
// x121EA.SupportDistance(x121EASupportDistance);
|
||||||
x121EA.MaxNumberOfSupports(x121EAMaxNumberOfSupports);
|
// x121EA.MaxNumberOfSupports(x121EAMaxNumberOfSupports);
|
||||||
x121EA.SupportVolumeMultiplier(x121EASupportVolumeMultiplier);
|
// x121EA.SupportVolumeMultiplier(x121EASupportVolumeMultiplier);
|
||||||
x121EA.MaxAllowedSupportVolume(x121EAMaxAllowedSupportVolume);
|
// x121EA.MaxAllowedSupportVolume(x121EAMaxAllowedSupportVolume);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Grid ...
|
// Grid ...
|
||||||
|
|||||||
Reference in New Issue
Block a user