This commit is contained in:
2024-06-28 17:30:41 +03:30
parent 313e75988e
commit 94fb860aab
2 changed files with 110 additions and 55 deletions
+91 -40
View File
@@ -3289,6 +3289,49 @@ public:
mIgnoreSL = value; mIgnoreSL = value;
} }
//
bool IncreaseNextSignalsVolume()
{
return mIncreaseNextSignalsVolume;
}
//
void IncreaseNextSignalsVolume(bool value)
{
mIncreaseNextSignalsVolume = value;
}
//
double IncreaseNextSignalsVolumeMultiplier()
{
return mIncreaseNextSignalsVolumeMultiplier;
}
//
void IncreaseNextSignalsVolumeMultiplier(double value)
{
//
if (value <= 0)
{
value = 0;
}
//
mIncreaseNextSignalsVolumeMultiplier = value;
}
//
bool AcceptNextDirectionalSignalsWhenFirstInProfit()
{
return mAcceptNextDirectionalSignalsWhenFirstInProfit;
}
//
void AcceptNextDirectionalSignalsWhenFirstInProfit(bool value)
{
mAcceptNextDirectionalSignalsWhenFirstInProfit = value;
}
// //
// Signalling ... // Signalling ...
@@ -4456,6 +4499,7 @@ public:
// //
// Only Accept Next Same Type when Previous in Profit ... // Only Accept Next Same Type when Previous in Profit ...
bool isSameTypeExists = false;
if (isSignalValid) if (isSignalValid)
{ {
// //
@@ -4523,7 +4567,9 @@ public:
} }
// //
if (IsValidSize(iSymbolsPositionsCount)) bool acceptNewOnlyWhenLastInProfit = AcceptNextDirectionalSignalsWhenFirstInProfit();
isSameTypeExists = IsValidSize(iSymbolsPositionsCount);
if (isSameTypeExists && acceptNewOnlyWhenLastInProfit)
{ {
// //
XPosition youngest; XPosition youngest;
@@ -4543,7 +4589,7 @@ public:
} }
} }
// //
// Multiply Signal Volume ... // Multiply Signal Volume ...
if (isSignalValid) if (isSignalValid)
{ {
@@ -4586,11 +4632,13 @@ public:
} }
// //
IncreaseNextSignalsVolume bool canIncreaseVolume = IncreaseNextSignalsVolume();
if (canIncreaseVolume)
// {
// Ignore ... //
iSignal.volume = iSignal.volume * multiplier; double volumeMultiplier = IncreaseNextSignalsVolumeMultiplier();
iSignal.volume = iSignal.volume * (multiplier * volumeMultiplier);
}
} }
// //
@@ -4606,11 +4654,14 @@ public:
} }
// //
// Cutom Signal Execution ... result = ArraySize(eSignals);
HandleSignals(eSignals);
// //
result = ArraySize(signals); // Cutom Signal Execution ...
if (IsValidSize(result))
{
HandleSignals(eSignals);
}
// //
return result; return result;
@@ -4948,14 +4999,16 @@ private:
// //
// Risk Management ... // Risk Management ...
double mVolume; // Volume double mVolume; // Volume
double mTPPoint; // TP Point double mTPPoint; // TP Point
double mSLPoint; // SL Point double mSLPoint; // SL Point
int mMaxAllowedTrades; // Max Alloed Positions bool mIgnoreTP; // Ignore Calculated TP
bool mIncreaseNextSignalsVolume; // Increase Next Signals Volume bool mIgnoreSL; // Ignore Calculated SL
bool mUseMaxAllowedPerDirection; // Use Max Allowed Positions Per Direction int mMaxAllowedTrades; // Max Alloed Positions
bool mIgnoreTP; // Ignore Calculated TP bool mUseMaxAllowedPerDirection; // Use Max Allowed Positions Per Direction
bool mIgnoreSL; // Ignore Calculated SL bool mIncreaseNextSignalsVolume; // Increase Next Signals Volume
double mIncreaseNextSignalsVolumeMultiplier; // Increase Next Signals Volume Multiplier
bool mAcceptNextDirectionalSignalsWhenFirstInProfit; // Accept Same Symbol/Type Signal when Last in Profit
// //
// Signalling ... // Signalling ...
@@ -4972,10 +5025,8 @@ private:
// - Increase Volume Size of in Profit Positions; // - Increase Volume Size of in Profit Positions;
// - etc ... // - etc ...
// bool mForceState; // Determine in Force State or not // bool mForceState; // Determine in Force State or not
int mDelayBetweenTwoSignal; // Delay between two same signal
int mMaxPositionsForce; // Max Number of Positions For Guard Handling
double mMaxDrawdownForce; // Force Handling State on Drawdown for Guard double mMaxDrawdownForce; // Force Handling State on Drawdown for Guard
bool mAllowSymbolHedgeOnForce; // Allow Symbol Hedging on Force States int mDelayBetweenTwoSignal; // Delay between two same signal
double mMinFreeMargingForOpenTrades; // Min Free Margin for Open Trades double mMinFreeMargingForOpenTrades; // Min Free Margin for Open Trades
// //
@@ -5394,26 +5445,26 @@ private:
// //
; ;
// //
AddRef( AddRef(
signal, signal,
signals // signals //
); );
// //
// Add new Signal Info ... // Add new Signal Info ...
mTradeHandler.Add( mTradeHandler.Add(
signal, signal,
pushers, pushers,
canGrid, canGrid,
canRecover, canRecover,
canSupport, canSupport,
conditions[0], conditions[0],
conditions[1], conditions[1],
conditions[2], conditions[2],
conditions[3], conditions[3],
conditions[4] // conditions[4] //
); );
} }
// //
+19 -15
View File
@@ -57,15 +57,17 @@ input bool x121EAGetVerificationFromOtherTimeFrames = true;
// //
// Risk Management ... // Risk Management ...
input group "Risk Management"; input group "Risk Management";
input double x121EAVolume = 0.01; // Static Volume input double x121EAVolume = 0.01; // Static Volume
input double x121EATPPoint = 1000; // TP Point input double x121EATPPoint = 1000; // TP Point
input double x121EASLPoint = 1000; // SL Point input double x121EASLPoint = 1000; // SL Point
input int x121EAMaxAllowedTrades = 0; // Max Allowed Positions Per Symbol input bool x121EAIgnoreSL = false; // Ignore Calculated SL
input bool x121EAIncreaseNextSignalsVolume = false; // Increase Next Signals Volume input bool x121EAIgnoreTP = false; // Ignore Calculated TP
input int x121EAMinFreeMargingForOpenTrades = 900; // Min Margin For Opening Trades input int x121EAMaxAllowedTrades = 0; // Max Allowed Positions Per Symbol
input bool x121EAUseMaxAllowedPerDirection = true; // Use Max Allowed Positions Per Direction input int x121EAMinFreeMargingForOpenTrades = 900; // Min Margin For Opening Trades
input bool x121EAIgnoreSL = false; // Ignore Calculated SL input bool x121EAUseMaxAllowedPerDirection = true; // Use Max Allowed Positions Per Direction
input bool x121EAIgnoreTP = false; // Ignore Calculated TP input bool x121EAIncreaseNextSignalsVolume = false; // Increase Next Signals Volume
input double x121EAIncreaseNextSignalsVolumeMultiplier = 1; // Increase Next Signals Volume Multiplier
input bool x121EAAcceptNextDirectionalSignalsWhenFirstInProfit = true; // Accept Same Symbol/Type Signal when Last in Profit
// //
// Protection ... // Protection ...
@@ -79,10 +81,10 @@ input bool x121EACloseOnOpposit = false; // Close all Positions on Opposit
input group "Trailling"; input group "Trailling";
input bool x121EAAllowTrailStop = true; // Enable Trailling Stop Losses input bool x121EAAllowTrailStop = true; // Enable Trailling Stop Losses
input bool x121EADisableTrailingWhenOpposit = true; // Disable Trailling When has Opposite In Drawdown input bool x121EADisableTrailingWhenOpposit = true; // Disable Trailling When has Opposite In Drawdown
input double x121EAFirstTrailDistance = 100; // Start Trailling Distance input double x121EAFirstTrailDistance = 100; // Start Trailling Distance
input double x121EAFirstTrailPoint = 60; // First Stop Trail input double x121EAFirstTrailPoint = 60; // First Stop Trail
input double x121EANextTrailDistance = 50; // Next Trailling Distance input double x121EANextTrailDistance = 50; // Next Trailling Distance
input double x121EANextTrailPoint = 25; // Next Trailling Step input double x121EANextTrailPoint = 25; // Next Trailling Step
// //
input group "Supporting"; input group "Supporting";
@@ -95,8 +97,8 @@ input double x121EAMaxAllowedSupportVolume = 0; // Max Allowed Support Signals V
// //
input group "Grid"; input group "Grid";
input bool x121EAAllowGrid = false; // Allow Grid Signals input bool x121EAAllowGrid = false; // Allow Grid Signals
input bool x121EAGridOnlyForces = false; // Grid Only Force Signals input bool x121EAGridOnlyForces = false; // Grid Only Force Signals
input int x121EAMaxNumberOfGrids = 0; // Max Number of Grid Signals input int x121EAMaxNumberOfGrids = 0; // Max Number of Grid Signals
input double x121EAGridDistance = 200; // Grid Distance input double x121EAGridDistance = 200; // Grid Distance
input double x121EAGridVolumeMultiplier = 2; // Grid Volume Multiplier input double x121EAGridVolumeMultiplier = 2; // Grid Volume Multiplier
@@ -329,6 +331,8 @@ bool InitialEA()
x121EA.IncreaseNextSignalsVolume(x121EAIncreaseNextSignalsVolume); x121EA.IncreaseNextSignalsVolume(x121EAIncreaseNextSignalsVolume);
x121EA.UseMaxAllowedPerDirection(x121EAUseMaxAllowedPerDirection); x121EA.UseMaxAllowedPerDirection(x121EAUseMaxAllowedPerDirection);
x121EA.MinFreeMargingForOpenTrades(x121EAMinFreeMargingForOpenTrades); x121EA.MinFreeMargingForOpenTrades(x121EAMinFreeMargingForOpenTrades);
x121EA.IncreaseNextSignalsVolumeMultiplier(x121EAIncreaseNextSignalsVolumeMultiplier);
x121EA.AcceptNextDirectionalSignalsWhenFirstInProfit(x121EAAcceptNextDirectionalSignalsWhenFirstInProfit);
// //
// Protection ... // Protection ...