Apply Fix on Signal Delays ...
This commit is contained in:
@@ -195,6 +195,7 @@ string mTag = "";
|
||||
|
||||
//
|
||||
double eaR2R = 1.5;
|
||||
datetime lastSignalOn = NULL;
|
||||
bool eaUseFixedTPSLPoints = true;
|
||||
|
||||
//
|
||||
@@ -1002,6 +1003,20 @@ void OnSignalRecieved(
|
||||
)
|
||||
: conditionsSummary;
|
||||
|
||||
//
|
||||
// Check Signal Delay ...
|
||||
datetime currentTime = TimeCurrent();
|
||||
int delay = eaDelayBarBetweenTwoSameSignal;
|
||||
bool isDelayPassed = delay <= 0
|
||||
? true
|
||||
: !IsValid(lastSignalOn)
|
||||
? true
|
||||
: MathAbs(TimeToSeconds(currentTime)) - MathAbs(TimeToSeconds(lastSignalOn)) >= ulong(delay * PeriodSeconds(_Period));
|
||||
if (!isDelayPassed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// Execute Signal Using Trade Handler ...
|
||||
ENUM_X_SIGNAL_EXECUTION_RESULT state;
|
||||
@@ -1009,6 +1024,12 @@ void OnSignalRecieved(
|
||||
signal,
|
||||
state //
|
||||
);
|
||||
|
||||
//
|
||||
if (isExecuted)
|
||||
{
|
||||
lastSignalOn = currentTime;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user