apply signaller's Policies in EA signal manager before Execute Signals ...
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user