apply signaller's Policies in EA signal manager before Execute Signals ...

This commit is contained in:
2024-06-05 06:25:20 +03:30
parent 00631650dc
commit 6b05f48cde
8 changed files with 447 additions and 15 deletions
+58 -6
View File
@@ -2537,18 +2537,36 @@ public:
// Props ...
//
ENUM_XSIGNAL_PROVIDERS name;
ENUM_XSIGNAL_PROVIDERS name; // Signaller Name
//
bool allowLong;
bool allowShort;
bool allowLong; // Allow Long Positions
bool allowShort; // Allow Short Positions
//
double r2r;
double r2r; // Risk To Reward Ratio
//
double staticVolumeLong; // Static Volume for Long
double staticVolumeShort; // Static Volume For Short
//
int maxAllowedLong; // Max Allowed Same Time Long Open Positions
int maxAllowedShort; // Max Allowed Same Time Short Open Positions
//
int delayBetweenTwoSameTypeSignals; // Delay between Two Same Type Signals
int maxAllowedOpenPositionAge; // Close Position if Still Alive bigger than this value
//
double minRequiredProfitPerTrade; // Minimum Required Profit Per Trade for Hedging
double minRequiredProfitPerTradeVolumeFactor; // Calculate Required Profit Based on Volume Factor for Hedging
//
bool openNextPositionOnProfit; // Open Next Signaller Position only When Previous Signals in Profit
bool ignoreProfitForOppositeSignals; // Ignore In Profit Policy when Opposite Signal Comming
//
double staticVolumeLong;
double staticVolumeShort;
//
// Constructor ...
@@ -2576,6 +2594,20 @@ public:
//
staticVolumeLong = 0;
staticVolumeShort = 0;
//
maxAllowedLong = 0;
maxAllowedShort = 0;
maxAllowedOpenPositionAge = 0;
delayBetweenTwoSameTypeSignals = 0;
//
minRequiredProfitPerTrade = 0;
minRequiredProfitPerTradeVolumeFactor = 0;
//
openNextPositionOnProfit = false;
ignoreProfitForOppositeSignals = false;
}
//
@@ -2604,11 +2636,31 @@ public:
}
//
// Retrieve Signaller Name as String ...
string GetName()
{
return ToString(name);
}
//
// Check Hedge is Enable or Not ...
bool AllowHedge()
{
//
bool result = false;
//
result =
//
minRequiredProfitPerTrade > 0 &&
minRequiredProfitPerTradeVolumeFactor > 0
//
;
//
return result;
}
//
// Generate Signal ...
bool GenerateSignal(