This commit is contained in:
2024-06-12 18:38:23 +03:30
parent 834090a2be
commit 0fa788d126
3 changed files with 40 additions and 55 deletions
+21
View File
@@ -729,6 +729,26 @@ public:
mReuiredSignalVerifications = value; mReuiredSignalVerifications = value;
} }
//
int MaxAllowedTrades()
{
return mMaxAllowedTrades;
}
//
void MaxAllowedTrades(int value)
{
//
if (value < 0)
{
value = 0;
}
//
mMaxAllowedTrades = value;
mTrader.SetMaxAllowedPositions(value);
}
// //
bool IsEnable() bool IsEnable()
{ {
@@ -1489,6 +1509,7 @@ private:
double mSLPoint; // SL Point double mSLPoint; // SL Point
bool mIgnoreTP; // Ignore Calculated TP bool mIgnoreTP; // Ignore Calculated TP
bool mIgnoreSL; // Ignore Calculated SL bool mIgnoreSL; // Ignore Calculated SL
int mMaxAllowedTrades; // Max Alloed Positions
bool mCloseOnOpposit; // Close all Positions on Opposit bool mCloseOnOpposit; // Close all Positions on Opposit
int mReuiredSignalVerifications; // Required Verifications for Validate Signals int mReuiredSignalVerifications; // Required Verifications for Validate Signals
+13 -50
View File
@@ -605,12 +605,6 @@ public:
return mMagicNumber; return mMagicNumber;
} }
//
int GetManageInterval()
{
return mManageInterval;
}
// //
double GetMaxAllowedSpread() double GetMaxAllowedSpread()
{ {
@@ -623,6 +617,19 @@ public:
return mMaxAllowedPositions; return mMaxAllowedPositions;
} }
//
void SetMaxAllowedPositions(int value)
{
//
if (value < 0)
{
value = 0;
}
//
mMaxAllowedPositions = value;
}
// //
double GetMaxAllowedDrawdownFactor() double GetMaxAllowedDrawdownFactor()
{ {
@@ -1062,46 +1069,6 @@ public:
return result; return result;
} }
//
// Manage ...
// this must be Call on OnTick for Manage
// Positions ...
// NOTE: Call this Before Checking IsNewBar ...
void Manage()
{
// //
// // All required Position Managements Actions implemented here ...
// datetime tmc = TimeCurrent();
// bool canManage = !IsValid(mLastManageOn)
// ? true
// : mLastManageOn + mManageInterval >= tmc;
// if (!canManage)
// {
// return;
// }
// //
// mLastManageOn = tmc;
//
// - [] Partial Close;
// - [] Risk Free;
// - [] Trail Stop;
// - [] SLS;
// - [] TPS;
//
// - [] Data Collector;
// - [] Profit Management;
//
// TODO: Implement them ...
//
// Implement Signal Collector Inside this Class
// and Manipulate Signals when SL/TP/Partial Close/Trail Stop/Profit/Close/ Modify and etc Happens ...
}
// //
// Execute a Signal ... // Execute a Signal ...
bool ExecuteSignal( bool ExecuteSignal(
@@ -3673,10 +3640,6 @@ private:
int mSlippage; // Slippage ... int mSlippage; // Slippage ...
ulong mMagicNumber; // Magic Number (Unique Identifier) ... ulong mMagicNumber; // Magic Number (Unique Identifier) ...
//
datetime mLastManageOn; // Last Manager Check
int mManageInterval; // Manager Check Intervals Seconds
// //
double mMaxAllowedSpread; // Max Allowed Spred for Opening Trades double mMaxAllowedSpread; // Max Allowed Spred for Opening Trades
int mMaxAllowedPositions; // Max Allowed Same Positions int mMaxAllowedPositions; // Max Allowed Same Positions
+6 -5
View File
@@ -43,15 +43,16 @@ string x121EASymbols = "EURUSDb"; // Symbols
// Signals ... // Signals ...
bool x121EAAllowLong = true; // Allow Long Trades bool x121EAAllowLong = true; // Allow Long Trades
bool x121EAAllowShort = true; // Allow Short Trades bool x121EAAllowShort = true; // Allow Short Trades
int x121EAReuiredSignalVerifications = 3; // Required Verifications for Signals int x121EAReuiredSignalVerifications = 5; // Required Verifications for Signals
// //
// Risk Management ... // Risk Management ...
double x121EAVolume = 0.01; // Static Volume double x121EAVolume = 0.01; // Static Volume
double x121EATPPoint = 30; // TP Point double x121EATPPoint = 50; // TP Point
double x121EASLPoint = 300; // SL Point double x121EASLPoint = 500; // SL Point
int x121EAMaxAllowedTrades = 1; // Max Allowed Positions
bool x121EAIgnoreSL = false; // Ignore Calculated SL bool x121EAIgnoreSL = false; // Ignore Calculated SL
bool x121EAIgnoreTP = false; // Ignore Calculated TP bool x121EAIgnoreTP = false; // Ignore Calculated TP
bool x121EACloseOnOpposit = false; // Close all Positions on Opposit bool x121EACloseOnOpposit = false; // Close all Positions on Opposit
// //