transfer important area and its related methods and Properties to XStrategy class ...
This commit is contained in:
@@ -307,12 +307,12 @@ bool InitialEA()
|
||||
eaSlippage,
|
||||
eaMagicNumber,
|
||||
true, // Ignore Signal Execution
|
||||
true, // Use TP SL Point
|
||||
false, // Use TP SL Point
|
||||
false, // Use Max
|
||||
eaTPPoint, // TP
|
||||
eaSLPoint, // SL
|
||||
eaIgnoreTP,
|
||||
true, // eaIgnoreSL,
|
||||
false, // eaIgnoreSL,
|
||||
eaAllowLong,
|
||||
eaAllowShort,
|
||||
eaMaxAllowedLongs, // Max Longs
|
||||
@@ -447,6 +447,23 @@ void HandleTradeState()
|
||||
// Analyzing ...
|
||||
void OnSignalRecieved(XSignal &signal)
|
||||
{
|
||||
//
|
||||
if (!signal.IsValid())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
bool isLong = IsLong(signal.type);
|
||||
|
||||
//
|
||||
// Check Allow Trade Type ...
|
||||
if ((isLong && !eaAllowLong) ||
|
||||
(!isLong && !eaAllowShort))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Check Max Allowed ...
|
||||
if (eaMaxAllowedLongs > 0 || eaMaxAllowedShorts > 0)
|
||||
@@ -480,8 +497,12 @@ void OnSignalRecieved(XSignal &signal)
|
||||
int shortsCount = ArraySize(shorts);
|
||||
|
||||
//
|
||||
if ((eaMaxAllowedLongs > 0 && longsCount >= eaMaxAllowedLongs) ||
|
||||
(eaMaxAllowedShorts > 0 && shortsCount >= eaMaxAllowedShorts))
|
||||
if ((isLong &&
|
||||
eaMaxAllowedLongs > 0 &&
|
||||
longsCount >= eaMaxAllowedLongs) ||
|
||||
(!isLong &&
|
||||
eaMaxAllowedShorts > 0 &&
|
||||
shortsCount >= eaMaxAllowedShorts))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user